-
-
Notifications
You must be signed in to change notification settings - Fork 478
Open
Labels
type: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Description
Describe the problem
using serial monitor to show variables etc does not work i.e.
input string to serial input with the code below should give output on serial monitor, it outputs nothing
I tested this using Arduino 1.8.19 ----- works perfectly
then with Arduino 2.3.6 ------ no output to serial window
To reproduce
note !! return character set to carriage return for this to work
void setup() {
Serial.begin(115200);
while(!Serial);
Serial.println("Serial started");
}
String kbdInput = "";
bool inptrdy = false;
//-------------------
void loop() {
if(Serial.available()) {
char c = Serial.read();
if(c != 13) {
kbdInput += c; // add c to string
}
else inptrdy = true;
Serial.print("serial ok c: ");
Serial.println(c);
Serial.println("kbdInput: " + kbdInput);
Serial.println("inputrdy: " + inptrdy);
}
if(inptrdy) {
Serial.println("inptrdy true kbdInput: " + kbdInput);
if(kbdInput == "c") {
Serial.println("Keyboard commands:");
}
else if(kbdInput == "tables") { // print tables
Serial.println("printTheTables()");
}
else if(kbdInput == "restart") { // restart node
Serial.println("Power On Reset this node");
}
kbdInput = "";
inptrdy = false;
}
}
Expected behavior
the code above should give output in the serial window when prompted with serial input followed by return
Arduino IDE version
2.3.6
Operating system
Windows
Operating system version
11
Additional context
No response
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the latest nightly build
- My report contains all necessary details
Metadata
Metadata
Assignees
Labels
type: imperfectionPerceived defect in any part of projectPerceived defect in any part of project