The Serial.parseInt function is amazing however I believe it has a major glitch when return the zero when a non integer char is introduced.
Why? Well... I am reading from the serial a
digit number between 0 and 23. So far so good.
I made a constraint so when the number is above 23 or below 0 it should not be accepted.
The problem is that if I introduce another char: like a char: a, b ,c... it returns "zero" and my program accepts that non valid char as "0".
What can I do to solve this issue? For example returning -1 is OK for me but I have to change the library and if I share this software with other they also have to change that return value.