Hey all,
I'm trying to input a number between 0-255 via serial into arduino and have it register the number.
while (Serial.available() > 0) {
delay(5); //wait until all the data is received
int inByte = (Serial.read() - '0'); //subtract 48 from number. Totally not how I want to do this.
Serial.println(inByte, DEC);
}
I'm having a difficult time, though, trying to get it to take more than one digit at a time (i.e. 12 inputs 1, then 2 in 2 separate commands).
Also, it is not accepting the number as its number value, but instead of its ascii character table relationship number (i.e. 1 is 49, so when i input 1, it takes it as 49).
Thanks as always for any responses.