15 lines
253 B
Python
15 lines
253 B
Python
from machine import Pin
|
|
from utime import sleep
|
|
|
|
pin = Pin("LED", Pin.OUT)
|
|
|
|
print("LED starts flashing...")
|
|
while True:
|
|
try:
|
|
pin.toggle()
|
|
sleep(1) # sleep 1sec
|
|
except KeyboardInterrupt:
|
|
break
|
|
pin.off()
|
|
print("Finished.")
|