def startwalking():
# Make the buzzer buzz on and off, half a second of
# sound followed by half a second of silence
print("Start walking")
count = 1
while count <= 4:
print("Beep")
buzzer.on()
time.sleep(0.5)
buzzer.off()
time.sleep(0.5)
count += 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)
评论列表
文章目录