#Led control using switch(External resistor)
from machine import Pin
import time
led=Pin(5,Pin.OUT)
key=Pin(0,Pin.IN)
while True:
if key.value() == 1:
led.on()
else:
led.off()
#Led control using switch(External resistor)
from machine import Pin
import time
led=Pin(5,Pin.OUT)
key=Pin(0,Pin.IN)
while True:
if key.value() == 1:
led.on()
else:
led.off()