from machine import Pin
from time import sleep
btnPin=14
mybtn=Pin(btnPin,Pin.IN, Pin.PULL_DOWN)
while True:
butState=mybtn.value()
print(butState)
sleep(0.1)
if(butState==1):
print("button pressed:")
else:
print("button not pressed")
Loading
pi-pico-w
pi-pico-w