#霹靂燈2
from machine import Pin
from time import sleep_ms
def init_led() :
global led
led7 = Pin(13,Pin.OUT)
led6 = Pin(12,Pin.OUT)
led5 = Pin(14,Pin.OUT)
led4 = Pin(27,Pin.OUT)
led3 = Pin(26,Pin.OUT)
led2 = Pin(25,Pin.OUT)
led1 = Pin(33,Pin.OUT)
led0 = Pin(32,Pin.OUT)
led = [led0,led1,led2,led3,led4,led5,led6,led7]
def main():
init_led()
while True:
for i in led:
i.value(1)
sleep_ms(100)
for i in led:
i.value(0)
sleep_ms(100)
if __name__ == "__main__" :
main()