makgab
Posts: 33
Joined: Fri Oct 24, 2014 9:28 am

RPi + Adafruit TFT switch/button

Fri Oct 24, 2014 9:36 am

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?
--
G.

makgab
Posts: 33
Joined: Fri Oct 24, 2014 9:28 am

Re: RPi + Adafruit TFT switch/button

Fri Oct 24, 2014 11:18 am

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".
--
G.

Return to “General discussion”