from machine import Pin from time import sleep btn=Pin(0,Pin.IN) while(1): print(btn.value()) sleep(.5)