def startwalking():
# Make the buzzer buzz on and off, half a second of
# sound followed by half a second of silence
# GPIO.output(PinRedPedestrian, GPIO.LOW)
# GPIO.output(PinGreenPedestrian, GPIO.HIGH)
iCount = 1
while iCount <= 4:
GPIO.output(PinBuzzer, GPIO.HIGH)
time.sleep(0.5)
GPIO.output(PinBuzzer, GPIO.LOW)
time.sleep(0.5)
iCount += 1
# Turn the buzzer off and wait for 2 seconds
# (If you have a second green 'pedestrian' LED, make it flash on and
# off for the two seconds)
评论列表
文章目录