def stepForwardOld(speed, stepsL, stepsR):
# TODO don't allow nested call backs
global leftCount, rightCount, intCountL, intCountR
GPIO.add_event_detect(lineRight, GPIO.BOTH, callback=rightCounter, bouncetime=5)
GPIO.add_event_detect(lineLeft, GPIO.BOTH, callback=leftCounter, bouncetime=5)
leftCount = stepsL
rightCount = stepsR
lastL = 0
lastR = 0
intCountL = 0
intCountR = 0
# turnForward(speed, int (speed * stepsR / stepsL))
forward(speed)
评论列表
文章目录