import time
from machine import Pin
time.sleep(0.1) # Wait for USB to become ready
BTN_PIN = 16
button = Pin(BTN_PIN, Pin.IN, Pin.PULL_UP)
#==== code below ===============
# button is a variable that represents the button
while True:
if button.value() == 0:
print("Button Pressed")
else:
print("Please press the button")
time.sleep(0.3)