I have the following sketch uploaded to my Arduino Uno Rev3:
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println("Hello, World!");
delay(10);
}
When I run it, Hello, World! is continually printed to the Serial Monitor as expected.
I have the following Processing sketch:
import processing.serial.*;
Serial port;
void setup() {
port = new Serial(this, "/dev/cu.usbmodem1421", 9600);
}
void draw() {
}
When I run the Processing sketch, the Serial Monitor output gets corrupted. The clean lines of Hello, World! end up looking like this:
Hello, Wold!
Hell, Wrld!
He
Hello, o, Worlorld!
H
Hello,World!
ello World!
Hell, World!
Helo, orld
Hello,Worl!
Hello World!
d!
HellHello, W, World!
I would like to communicate between Processing and Arduino via the Serial, but I can't if the output is corrupt. What could be causing this?