system
1
hi all, i would like to ask,
i'm currently sending a value for example 1000 from my c# to the arduino.
i am reading from serial 3 btw. this is how i read from the arduino:
int value;
if (serial3.available >2){
value = serial3.read();
serial.print(value);
}
but when i open my serial monitor, the value is not 1000, it is within 0 to 255. what can i do if i want to receive my exact value of 1000?
tiv!
system
2
Serial reads byte values - 0/255 only, you need to read an integer it seems.
This post may help.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1191880368
system
3
hey thanks, i would try the method and see how ! tks
value = serial3.read();
You're only reading a single byte, so it will be between 0 and 255.
Try something like
value = (serial3.read() << 8) + serial3.read();
Assuming the data is binary and transmitted MSB first.
Rob