User Manual
88
if (Last_RoB_Status == 0) and (Current_RoB_Status == 1):
counter = counter + 1
if (Last_RoB_Status == 1) and (Current_RoB_Status == 0):
counter = counter - 1
print 'counter = %d' % counter
# Define a callback function on switch, to clean "counter"
def clear(ev=None):
global counter
counter = 0
Now, gently rotate the encoder to change the v alue of the v ariable in the above program,
and you w ill see the v alue printed on the screen. Rotate the encoder clockwise, the value
will increase; or rotate it counterclockwise, the value will decrease.
SunFounder