7-TrafficLights-solution.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:EduKit1 作者: CamJam-EduKit 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号