arduino / ArduinoCore-sam

80 stars 107 forks source link

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

Open Silver-Fang opened 6 months ago

Silver-Fang commented 6 months ago
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.