Hi,
I expect integers from 0 to 360 (degrees) comming from arduino to processing, but processing gives me a chaos, consisting 49, 49, 51, 48...unexpected!
Arduino, generates integers:
long angle = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println(angle);
angle += 1;
if(angle>=360)
angle = 0;
}
Processing, reads the serial port:
import processing.serial.*;
int angle=0;
Serial port;
void setup()
{
port = new Serial(this, "COM4", 9600);
}
void draw()
{
if(port.available() > 0)
{
println(port.read());
}
}
where am I wrong? (COM4 is the right port on both)