hello everyone
i have a problem with receiving data from processing.
this is how i send it:
port = new Serial(this, Serial.list()[0], 9600);
port.write(1086);
and this is how i receive it in the arduino code:
serbyte = Serial.read();
if (serbyte != -1) {
dataArrayH[0] = serbyte-1000;
}
this works fine but i get a problem when i try to make this:
serbyte = Serial.read();
if (serbyte != -1) {
if (serbyte >= 1000 && serbyte < 2000) {
dataArrayH[0] = serbyte-1000;
}
}
after searching the forum i think the problem is that the Serial.read has ASCII output
but i still didn't get my code to work.
could anyone axplain me why this: " if (serbyte >= 1000 && serbyte < 2000) {" is not working?
thx a lot