from machine import Pin
from time import sleep_ms
led=Pin(25,Pin.OUT)
key=Pin(21,Pin.IN,Pin.PULL_UP)
while 1:
print(key.value())
if key.value()==0:
led.on()
else:
led.off()
sleep_ms(300)
from machine import Pin
from time import sleep_ms
led=Pin(25,Pin.OUT)
key=Pin(21,Pin.IN,Pin.PULL_UP)
while 1:
print(key.value())
if key.value()==0:
led.on()
else:
led.off()
sleep_ms(300)