def rightCounterOld(channel):
global rightCount, lastR, intCountR
intCountR += 1
val = GPIO.input(lineRight)
time.sleep(0.02)
if val == GPIO.input(lineRight) and val != lastR:
rightCount -= 1
lastR = val
if rightCount <= 0:
a.ChangeDutyCycle(0)
b.ChangeDutyCycle(0)
GPIO.remove_event_detect (channel)
print "Done right", intCountR
# ======== End of Old deprecated functions =========
# End of Motor Functions
#======================================================================
#======================================================================
# RGB LED Functions
# (Full version only)
#
# setLED(LED, Red, Green, Blue): Sets the LED specified to required RGB value. 0 >= LED <= 3; 0 <= R,G,B <= 4095
评论列表
文章目录