# coding: utf-8
import RPi.GPIO as GPIO
import time
led_port_list =
def led_init():
GPIO.setmode(GPIO.BCM)
for port in led_port_list:
GPIO.setup(port, GPIO.OUT, initial=GPIO.HIGH)
#GPIO.output(port, False)
time.sleep(1)
for port in led_port_list:
GPIO.output(port, False)
def led_start():
while True:
for port in led_port_list:
GPIO.output(port, True)
time.sleep(0.1) #sleep
GPIO.output(port, False)
if __name__ == '__main__':
led_init()
led_start()
厉害啊,我也来试验下 楼主怎么接线的啊? 万能的Python啊!哈哈不错的 。 顶一个!我是新手 好奇心很重!
页:
1
[2]