Difference between revisions of "2.2 Inch TFT Screen Display Extension Board"

From Wiki
Jump to: navigation, search
Line 1: Line 1:
[[File:TFT1.jpg]]
 
 
 
==Features==
 
==Features==
 +
[[File:TFT1.jpg]]<br>
  
 
*Size: 65mm×56.5mm, standard as a Raspberry Pi HAT board
 
*Size: 65mm×56.5mm, standard as a Raspberry Pi HAT board
Line 37: Line 36:
 
'''SJ1''' is the switch for IR control.
 
'''SJ1''' is the switch for IR control.
  
1.Connect the two soldering pads of SJ1 by solder.
+
===1.Connect the two soldering pads of SJ1 by solder.===
  
2. Update and install the LIRC. Run:
+
===2. Update and install the LIRC. Run:===
  
 
  sudo apt-get update
 
  sudo apt-get update
 
  sudo apt-get install lirc
 
  sudo apt-get install lirc
3.Edit /boot/config.txt and add settings. IR receiver of the extension board = 26<br />
+
===3.Edit /boot/config.txt and add settings. IR receiver of the extension board = 26===
 
  sudo nano /boot/config.txt<br />
 
  sudo nano /boot/config.txt<br />
 
Add the following line to config.txt<br />
 
Add the following line to config.txt<br />
 
  dtoverlay=lirc-rpi,gpio_in_pin=26<br />
 
  dtoverlay=lirc-rpi,gpio_in_pin=26<br />
4.Edit the configuration file of LIRC to enable the Infrared function:<br />
+
===4.Edit the configuration file of LIRC to enable the Infrared function:===
 
  sudo nano /etc/lirc/hardware.conf<br />
 
  sudo nano /etc/lirc/hardware.conf<br />
 
Change the following lines:<br />
 
Change the following lines:<br />
Line 55: Line 54:
 
  MODULES="lirc_rpi"
 
  MODULES="lirc_rpi"
 
Note that there should be two hyphens in "--uinput".<br />
 
Note that there should be two hyphens in "--uinput".<br />
5.Reboot the Raspberry Pi.<br />
+
===5.Reboot the Raspberry Pi.===
 
  sudo reboot<br />
 
  sudo reboot<br />
 
And then, check whether the Infrared function is enabled.<br />
 
And then, check whether the Infrared function is enabled.<br />
Line 62: Line 61:
 
If you see the contents are displayed as shown in the above red box, it means the function is active now.
 
If you see the contents are displayed as shown in the above red box, it means the function is active now.
  
6.Record the buttons
+
===6.Record the buttons===
  
sudo /etc/init.d/lirc stop
+
sudo /etc/init.d/lirc stop
sudo irrecord -n -d /dev/lirc0 ~/lircd.conf
+
sudo irrecord -n -d /dev/lirc0 ~/lircd.conf
  
 
Record the buttons for your remote control as prompted. Record respectively "'''pause'''", "'''nextsong'''", "'''prevsong'''", "'''stop'''", "'''volumeup'''", and "v'''olumedown'''".
 
Record the buttons for your remote control as prompted. Record respectively "'''pause'''", "'''nextsong'''", "'''prevsong'''", "'''stop'''", "'''volumeup'''", and "v'''olumedown'''".
Line 71: Line 70:
 
Overwrite the corresponding lirc file with the recorded ~/lircd.conf
 
Overwrite the corresponding lirc file with the recorded ~/lircd.conf
  
sudo cp ~/lircd.conf /etc/lirc/lircd.conf
+
sudo cp ~/lircd.conf /etc/lirc/lircd.conf
  
7.Start lirc
+
===7.Start lirc===
  
 
  sudo /etc/init.d/lirc start
 
  sudo /etc/init.d/lirc start
8.Check the status of recording. Run
+
===8.Check the status of recording. Run===
  
 
  irw
 
  irw
 
Then press the buttons recorded before in turns.
 
Then press the buttons recorded before in turns.
  
9.You can also view the name of the recorded and ready-for-use buttons by the command irsend
+
===9.You can also view the name of the recorded and ready-for-use buttons by the command irsend===
  
 
  irsend LIST /home/pi/lircd.conf
 
  irsend LIST /home/pi/lircd.conf
Line 88: Line 87:
 
  irsend: 000000000000c837 pause
 
  irsend: 000000000000c837 pause
 
  irsend: 00000000000048b7 nextsong
 
  irsend: 00000000000048b7 nextsong
10.Now you can send the code of the recorded buttons on the remote by the Infrared emitter. You can thus use the extension board to change programs. Refer to the following commands:
+
===10.Now you can send the code of the recorded buttons on the remote by the Infrared emitter. ===
 +
You can thus use the extension board to change programs. Refer to the following commands:<br>
  
 
  irsend SEND_ONCE /home/pi/lircd.conf pause
 
  irsend SEND_ONCE /home/pi/lircd.conf pause

Revision as of 10:31, 17 June 2016

Features

TFT1.jpg

  • Size: 65mm×56.5mm, standard as a Raspberry Pi HAT board
  • Screen sizing 2.2 inch and supporting a 320x240 resolution with high PPI, being small but able to provide a fine image
  • Multi-button design: 6 buttons, meeting different demands for buttons from various users
  • With an Infrared receiver

Procedures for Applying TFT Screen Display with Raspbian Jessie

TFT2.jpg

Download the simplified installation package at the bottom (or here). Transfer it to the Raspberry Pi.

Finish the installation with Installation Guide which comes along with the product.

Buttons

TFT3.jpg

There are 6 buttons on the screen, which are marked by a number beginning with "#", such as #21, #22, etc. The number indicates that the pins are connected to GPIOs defined by BCM numbering.

Backlight control:

TFT6.jpg

SJ2 is the switch for backlight control. Connect the two soldering pads of SJ2 by solder. You can use #27 to switch on/off the backlight.

gpio -g mode 27 in  # Switch off
gpio -g mode 27 out # Switch on

Infrared Receiving:

TFT4.jpg

SJ1 is the switch for IR control.

1.Connect the two soldering pads of SJ1 by solder.

2. Update and install the LIRC. Run:

sudo apt-get update
sudo apt-get install lirc

3.Edit /boot/config.txt and add settings. IR receiver of the extension board = 26

sudo nano /boot/config.txt

Add the following line to config.txt

dtoverlay=lirc-rpi,gpio_in_pin=26

4.Edit the configuration file of LIRC to enable the Infrared function:

sudo nano /etc/lirc/hardware.conf

Change the following lines:

LIRCD_ARGS="--uinput"
DRIVER="default"
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"

Note that there should be two hyphens in "--uinput".

5.Reboot the Raspberry Pi.

sudo reboot

And then, check whether the Infrared function is enabled.

ls /dev/l*

TFT5.jpg
If you see the contents are displayed as shown in the above red box, it means the function is active now.

6.Record the buttons

sudo /etc/init.d/lirc stop sudo irrecord -n -d /dev/lirc0 ~/lircd.conf

Record the buttons for your remote control as prompted. Record respectively "pause", "nextsong", "prevsong", "stop", "volumeup", and "volumedown".

Overwrite the corresponding lirc file with the recorded ~/lircd.conf

sudo cp ~/lircd.conf /etc/lirc/lircd.conf

7.Start lirc

sudo /etc/init.d/lirc start

8.Check the status of recording. Run

irw

Then press the buttons recorded before in turns.

9.You can also view the name of the recorded and ready-for-use buttons by the command irsend

irsend LIST /home/pi/lircd.conf

You can see contents similar to the following displayed

irsend: 000000000000c837 pause
irsend: 00000000000048b7 nextsong

10.Now you can send the code of the recorded buttons on the remote by the Infrared emitter.

You can thus use the extension board to change programs. Refer to the following commands:

irsend SEND_ONCE /home/pi/lircd.conf pause
irsend SEND_ONCE /home/pi/lircd.conf nextsong
irsend SEND_ONCE /home/pi/lircd.conf KEY_VOLUMEDOWN
irsend SEND_ONCE /home/pi/lircd.conf KEY_VOLUMEUP

Pitft_setupZIP.jpg