Hello, I´m new in Arduino and i have a problem with a code.
When I deposit the number 35 for the monitor series does not do at all my code, only it works if I put individual numbers as 0, 1, 2, .... , 9.
I do not manage to store in the variable numbers more of two digits since it it is 35.
When you type in your Serial monitor 35 and send you are sending 2 bytes. Serial.read() only read one byte at a time so n will always just store one byte even if it an int!
When you do:
n = Serial.read();
You are just grabbing the first caracter
if(n == 35)
n will never be 35, it will be just 3
n = Serial.read();//Don't try to read if you don't have nothing to read Use if(Serial.available() >0) n = Serial.read();
n-=48;