Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with GPIO 0 - TTGO T-Display ST 7789V #329

Open
rems02 opened this issue Mar 16, 2021 · 1 comment
Open

Problem with GPIO 0 - TTGO T-Display ST 7789V #329

rems02 opened this issue Mar 16, 2021 · 1 comment

Comments

@rems02
Copy link

rems02 commented Mar 16, 2021

hi,
I have a problem with TTGO T-Display ST 7789V

Button GPIO 0 does not work after presses button (print always 0)
Button GPIO 35 it's OK (print 1 after presses button print 0)

test code:

from machine import Pin
from time import sleep

button = Pin(0, Pin.IN)

while True:
    print(button.value())
    sleep(0.1)

II have tested with other Micropython and it works.

is there a problem ?

Thanks for your help.

@MaXIP21
Copy link

MaXIP21 commented 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.
:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants