i've bought an PiTFT from Adafruit.
The TFT has 4 tactile buttons, that are connected to the GPIOs 23, 22, 21 and 18.
In the circuit diagram i've found a section that shows, how the tactile buttons are connected:
GPIO 23,22,21,18 (RPI-side) -> BUTTON1-4 -> GROUND.
http://learn.adafruit.com/system/assets ... 1387563188
My problem is, that i can't recognize a button press.
I've wrote a little python3 script, that should read out the status of a button and print a message.
Code: Select all
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(22,GPIO.IN)
GPIO.setup(21,GPIO.IN)
GPIO.setup(18,GPIO.IN)
while True:
if GPIO.input(22):
print("22 gedrückt!")
if GPIO.input(21):
print("21 gedrückt!")
if GPIO.input(18):
print("18 gedrückt!")
GPIO.cleanup()I start the above script as root and touch (dont press!) the most-right button; now i'm getting spammed with "18 gedrückt!". The other buttons dont give a print-Feedback.
Has someone a idea, how i could solve this?
