def flashingambergreen():
# Remember all code in the function is indented
GPIO.output(PinRed, GPIO.LOW)
iCount = 1
while iCount <= 6:
GPIO.output(PinAmber, GPIO.HIGH)
# GPIO.output(PinGreenPedestrian, GPIO.HIGH)
time.sleep(0.5)
GPIO.output(PinAmber, GPIO.LOW)
# GPIO.output(PinGreenPedestrian, GPIO.LOW)
time.sleep(0.5)
iCount += 1
# Flash the amber for one more second
# (Turn the green 'pedestrian' LED off and the red on)
评论列表
文章目录