Page 1 of 1

RPi + Adafruit TFT switch/button

Posted: Fri Oct 24, 2014 9:36 am
by makgab
Hi!

How can I set the TFT switch/button (http://adafru.it/1601)?
The pins are: #23 #22 #21 (#27) #18
With this (https://www.kernel.org/doc/Documentation/gpio/sysfs.txt) documentation I set that for example:
echo "18" > export

Then it was created in /sys/class/gpio/gpio18/:
'action_low': "0"
'direction': "in"
'edge': "none"
'uevent': ""
'value': "0"

It is ok.
If I press the "switch #18" then nothing happen! The "/sys/class/gpio/gpio18/value" still "0". Why?
What do I missing?

Re: RPi + Adafruit TFT switch/button

Posted: Fri Oct 24, 2014 11:18 am
by makgab
Thanks for Gordon! :)
https://projects.drogon.net/raspberry-p ... o-utility/
I need to activate the internal pull-up resistor:

Code: Select all

gpio -g mode 18 up
Then I get the state:

Code: Select all

gpio -g read 18
So, the default value is "1" and the button pressed state is "0".