Skip to content

Commit 9e5d4a3

Browse files
committed
examp: monitor.ino with user input TBT
1 parent 3394b38 commit 9e5d4a3

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

examples/monitor/monitor.ino

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,13 @@ void loop() {
4343

4444
Bridge.notify("signal", 200);
4545

46-
Monitor.write("DEBUG: a debug message");
47-
48-
// read needs to be fixed
49-
// String incoming_msg;
50-
// if (Monitor.read(incoming_msg, 64)) {
51-
// Serial.println(incoming_msg);
52-
// } else {
53-
// Serial.println("ERROR on Monitor.read");
54-
// }
46+
Monitor.println("DEBUG: a debug message");
47+
48+
if (Monitor.available()) {
49+
String input = Monitor.readStringUntil('\n'); // Read until newline
50+
Monitor.print("You entered: ");
51+
Monitor.println(input);
52+
}
5553

5654
Bridge.update();
5755

0 commit comments

Comments
 (0)