Modifications

Sauter à la navigation Sauter à la recherche
2 502 octets ajoutés ,  28 décembre 2013 à 21:44
Page créée avec « {{RASP-PiTFT-NAV}} == Contrôler le rétro-éclairage == There's a 4-LED backlight on the TFT and it draws ~75mA at all times. There might be times you'd like to save some p... »
{{RASP-PiTFT-NAV}}

== Contrôler le rétro-éclairage ==
There's a 4-LED backlight on the TFT and it draws ~75mA at all times. There might be times you'd like to save some power and turn off the backlight. The screen and touchplate will still work, you just can't see anything. We designed the board with the STMPE610 touchscreen controller which has 2 extra GPIO and tied one of them to the transistor that controls the backlight. You can use the command line to control the backlight.

Start by getting access to the GPIO by making a device link
<nowiki>sudo sh -c "echo 252 > /sys/class/gpio/export"
ls -l /sys/class/gpio</nowiki>

{{ADFImage|RASP-PiTFT-Extra-01.png}}

Once you verify that you see GPIO #252, then you can set it to an output, this will turn off the display since it will output 0 by default

<nowiki>sudo sh -c "echo 'out' > /sys/class/gpio/gpio252/direction"</nowiki>

Then turn the display back on with

<nowiki>sudo sh -c "echo '1' > /sys/class/gpio/gpio252/value"</nowiki>

or back off

<nowiki>sudo sh -c "echo '0' > /sys/class/gpio/gpio252/value"</nowiki>

{{ADFImage|RASP-PiTFT-Extra-02.png}}

== Bouton tactile comme bouton d'alimentation ==

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. You can use any of them or other GPIO but #23's our favorite number anyways.

You will have to grab ****** {{pl||a pack of slim tactile switches}} ***** or otherwise solder in a button

Add '''rpi_power_switch''' to '''/etc/modules''' and save

{{ADFImage|RASP-PiTFT-Extra-10.png}}

Now create a new conf file or edit our existing one with

<nowiki>sudo nano /etc/modprobe.d/adafruit.conf</nowiki>

and enter in the line

<nowiki>options rpi_power_switch gpio_pin=23 mode=0</nowiki>

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'''.

{{ADFImage|RASP-PiTFT-Extra-11.png}}

To make it active immediately run '''sudo modprobe rpi_power_switch'''

{{ADFImage|RASP-PiTFT-Extra-12.png}}

{{RASP-PiTFT-TRAILER}}
29 917

modifications

Menu de navigation