from machine import Pin
from utime import sleep
led=Pin(16,Pin.OUT)
button=Pin(3,Pin.IN)
while 1:
val=button.value()
print(val)
if val==0:
led.on()
else:
led.off()
sleep(0.1)
from machine import Pin
from utime import sleep
led=Pin(16,Pin.OUT)
button=Pin(3,Pin.IN)
while 1:
val=button.value()
print(val)
if val==0:
led.on()
else:
led.off()
sleep(0.1)