ArduinoCore-sam icon indicating copy to clipboard operation
ArduinoCore-sam copied to clipboard

Unexpected extra characters appeared in the IDE Serial Monitor when write to Serial in loop()

Open Ebola-Chan-bot opened this issue 1 year ago • 0 comments

void setup() {
  Serial.begin(9600);
  Serial.setTimeout(65535);
}
void loop() {
  Serial.println("Snapshot");
  char C;
  Serial.readBytes(&C,1);
}

Upload this sketch in Arduino IDE and open the Serial Monitor. There is a certain probability that unexpected random characters will be generated before normal output. image This is not likely an IDE problem because the same code uploaded to Mega2560 does not have this problem.

Ebola-Chan-bot avatar Mar 06 '24 12:03 Ebola-Chan-bot