The following evaluates true if the variables are int8, but not true if uint8 (which is correct).
// Turn relays on if over set level
if(relay >= dataLocal.level + dataLocal.hysteresis)
The values are: relay = 0, dataLocal.level = 128, dataLocal.hysteresis = 10.
What am I missing here? it seems like it is defying computer logic and calling 0 greater than 138...
Solved! Go to Solution.
The values an uint8 can represent are from 0 ro 255. From 255 it would overflow to 0
The values an int8 can represent are from -128 to 127, From 127 it would overflow to -128