Hello,
Using the code below and typing a "2" in the Serial Monitor I get:
2
-38
Why is that?
I just want rxVal to be saved/set as "2" but it always drops to -38 afterwards.
If i type in 456, I get:
4
5
6
-38
Thanks a lot for your help!
rxVal = 1;
void setup()
{
Serial.begin(9600);
}
void loop ()
{
if(Serial.available() > 0)
{
rxVal = Serial.read() -'0';
Serial.println(rxVal);
}
}