from machine import Pin
import time
button_pin = Pin(16, Pin.IN, Pin.PULL_UP)
led_pin = Pin(15, Pin.OUT)
while True:
if button_pin.value() == 1:
led_pin.value(1)
print ("button with lihgt")
else:
led_pin.value(0)
print ("button without lihgt")
time.sleep(1)