I have a peculiar problem with writing to a serial number on Arduino. I recently changed boards in the Duemilanove project on the Mega2560 . Part of my code makes a very simple sequential read from a processing program, for example:
if (Serial.available() > 0) {
byte c = Serial.read();
}
In the installation method, I open the 115200 Baud connection with:
Serial.begin(115200);
Anyway, this worked fine with Duemilanove, but now that I switched to Mega2560, the Arduino does not seem to be receiving serial data. However, to my surprise, when I open the serial monitor window before running a processing program that sends data, all data is sent correctly.
My question is: what will change a serial monitor that makes everything work and how can I recreate it in my processing program?
source
share