You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Problem with GPIO 0 - TTGO T-Display ST 7789V #329
The difference between the two pins is the following the Pin35 is pulled up by a resistor on the board and the Pin0 is not so you should define it as PULL_UP in order to use it, also if you define as Pin.IN the value can't be read so define it as Pin.INOUT so the correct code would be:
Activity
MaXIP21 commentedon Jan 14, 2022
Hello,
The difference between the two pins is the following the Pin35 is pulled up by a resistor on the board and the Pin0 is not so you should define it as PULL_UP in order to use it, also if you define as Pin.IN the value can't be read so define it as Pin.INOUT so the correct code would be:
from machine import Pin
from time import sleep
button = Pin(0, Pin.INOUT, Pin.PULL_UP)
while True:
print(button.value())
sleep(0.1)
and that will work.
:)