import machine
from time import sleep
# Define the button pin (change this to match your setup)
button_pin = machine.Pin(16, machine.Pin.IN, machine.Pin.PULL_DOWN)
while True:
# Read the state of the button
button_state = button_pin.value()
if button_state:
print("Button is pressed")
else:
print("Button is not pressed")
# Wait for a short duration (e.g., 100 milliseconds)
sleep(0.1)