MySensors-HW
MySensors-HW copied to clipboard
RollerShutter : bug in abs
Little bug in abs implementation for Arduino (but not only Arduino, abs must be banned from embeded devices !)
if (abs(oldacsread-acsread)>20)
if oldacsread=1 and acsread=2 abs return 65535 ! so the test is ok !
Simple workaround : change type of oldacsread and acsread to int16_t