import time
from machine import Pin
LED=Pin(16,Pin.OUT)
Switch=Pin(17,Pin.IN)
time.sleep(0.1) # Wait for USB to become ready
while True:
if(Switch.value()):
LED.on()
else:
LED.off()
import time
from machine import Pin
LED=Pin(16,Pin.OUT)
Switch=Pin(17,Pin.IN)
time.sleep(0.1) # Wait for USB to become ready
while True:
if(Switch.value()):
LED.on()
else:
LED.off()