Datasheet
Extras!
Tactile switch as power button
Its a good idea to safely turn off your Pi with a good sudo shutdown -h now but that often means pulling out a
keyboard or connecting to the console. With our kernel we added a cool module that will let you turn any GPIO into a
power button. Since there's a couple of tactile switches right there on the front, lets turn one into a power button. Press
once to properly turn off the pi, press again to start it up. Isn't that nice?
We'll be using GPIO #23, the left-most button on a PiTFT 2.8", on the 2.4" HAT, #16 is a good choice since its on a
tactile button. But, you can use any GPIO you want, really!
You will have to grab a pack of slim tactile switches or otherwise solder in a button
Add rpi_power_switch to /etc/modules and save
Now create a new conf file or edit our existing one with
sudo nano /etc/modprobe.d/adafruit.conf
and enter in the line
options rpi_power_switch gpio_pin=23 mode=0
Of course, change the gpio_pin setting to some other # if you wish. mode=0 means its a pushbutton
not
a switch. If
you happen to install an on/off switch, use mode=1
To make it active immediately run sudo modprobe rpi_power_switch
© Adafruit Industries
https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-
pi
Page 60 of 70










