In an effort to figure out what is wrong with a Matlab library designed to talk to a certain Arduino sketch, I have run into a problem that can be replicated with this code.
void setup() {
Serial.begin(9600);
Serial.println("Starting . . .");
}
void loop() {
delay(1000);
Serial.println("test");
}
If I run this code on my Uno SMD R2, built with IDE 1.0.1 on OS X 10.9 Mavericks, any characters that I send in the serial monitor make the Arduino freeze, or at least that's what seems to happen.
What I would expect to see in the serial console:
Starting . . .
test
test
test
<continuing forever>
But as soon as I send any character to the Arduino by typing in the box at the top of the serial monitor and clicking send, the word "test" stops appearing at 1-second intervals. I would expect it to just keep printing "test" forever.
Am I misunderstanding how the serial monitor works?
Thanks,
Brandon
Update: I am also able to replicate this with an Arduino Mega 2560. I also see a similar freeze when I run the SerialCallResponseASCII example and try sending data via the serial monitor. Additionally, it doesn't seem to be related to whether my host laptop is plugged into the wall or not.