You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

17 lines
243 B

from machine import Pin
from utime import sleep
led = Pin('LED', Pin.OUT)
state = False
def toggle_LED(state):
if state:
led.on()
else:
led.off()
while True:
state = not state
toggle_LED(state)
sleep(0.5)