from machine import Pin
from time import sleep
btn_pin = Pin(2,Pin.IN)
btn_pin = Pin(15,Pin.OUT)
while True:
btn_state = btn_pin.value()
print(btn_state)
if btn_state == 1:
led_pin.value(1)
else:
led_pin.value(0)
sleep(0.3)