# btn_status.py : By Opas Sirikunchittavorn
from machine import Pin
import time
button = Pin(16, Pin.IN)
led = Pin(15, Pin.OUT)
while True:
status = button.value()
if status == 0:
print("Button pressed")
led.value(1)
else:
print("Button not pressed")
led.value(0)
time.sleep(0.1)