Yes, just a typo,
The code was embedded in a lot of verbosity. I isolated the line and bracketed it with print statements and yes, with all the constants and variables revealed, zero minus zero was greater than 10. Until I recast the uint8_t zero to uint16_t zero. Then 10 was greater than zero, like in the olden days.
I'll make a new sketch and try to recreate the behavior.
vanduino:
Yes, just a typo,
The code was embedded in a lot of verbosity. I isolated the line and bracketed it with print statements and yes, with all the constants and variables revealed, zero minus zero was greater than 10. Until I recast the uint8_t zero to uint16_t zero. Then 10 was greater than zero, like in the olden days.
I'll make a new sketch and try to recreate the behavior.
Mixed type math gave bad results back in the day too. That's why I spotted that.
vanduino:
The code was embedded in a lot of verbosity. I isolated the line and bracketed it with print statements and yes, with all the constants and variables revealed, zero minus zero was greater than 10. Until I recast the uint8_t zero to uint16_t zero. Then 10 was greater than zero, like in the olden days.