waveshare 1.44" tft lcd HAT (st7735s) raspberry pi setup:
Enable ‘SPI’ inside ‘Advanced Options’ and then ‘SPI’. You will simply get a yes/no option for the ‘SPI’ setting.
Advanced Options’ section is ‘Overscan’. When asked ‘Would you like to enable compensation for displays with overscan?’ you can select No
sudo nano /etc/modules
add the following into the file (if the lines are not already there)
spi-bcm2835
fbtft_device
sudo nano /etc/modprobe.d/fbtft.conf
add:
options fbtft_device name=adafruit18_green gpios=reset:27,dc:25,cs:8,led:24 speed=40000000 bgr=1 fps=60 custom=1 height=128 width=128 rotate=180
sudo apt-get install cmake git
and now we have the tools, we can grab the code from github, and build it
cd ~
git clone https://github.com/tasanakorn/rpi-fbcp
cd rpi-fbcp/
mkdir build
cd build/
cmake ..
make
sudo install fbcp /usr/local/bin/fbcp
cd ~
git clone https://github.com/adafruit/Adafruit-Retrogame
cd Adafruit-Retrogame/
make
sudo make install
sudo nano /etc/udev/rules.d/10-retrogame.rules
edit /boot/retrogame.cfg and insert these:
LEFT 5 # Joypad left
RIGHT 26 # Joypad right
UP 6 # Joypad up
DOWN 19 # Joypad down
LEFTCTRL 21 # 'A' button
#LEFTALT 20 # 'B' button
SPACE 16 # 'Select' button
ENTER 20 # 'Start' button
sudo nano /etc/rc.local
insert the following commands
fbcp&
retrogame&
_IP=$(hostname -I) || true
if [ “$_IP” ]; then
printf “My IP address is %s\n” “$_IP”
fi
fbcp&
sudo retrogame&
exit 0
The file we are interested in here is called ‘config.txt’. If you open this file, you will see there are lots of commands and settings here. Scroll to the bottom of the file and add the following lines
dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4
hdmi_force_hotplug=1
hdmi_cvt=128 128 60 1 0 0 0
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
display_rotate=1
if needed change console font size to 6x12 (default 8x16):
references:
https://www.raspberrypi-spy.co.uk/2014/04/how-to-change-the-command-line-font-size/ https://www.waveshare.com/1.44inch-lcd-hat.htm
http://pi0cket.com/guides/tiny-software-for-tinypi/#more-99
https://www.raspberrypi.org/forums/viewtopic.php?t=207627
Advanced Options’ section is ‘Overscan’. When asked ‘Would you like to enable compensation for displays with overscan?’ you can select No
sudo nano /etc/modules
add the following into the file (if the lines are not already there)
spi-bcm2835
fbtft_device
sudo nano /etc/modprobe.d/fbtft.conf
add:
options fbtft_device name=adafruit18_green gpios=reset:27,dc:25,cs:8,led:24 speed=40000000 bgr=1 fps=60 custom=1 height=128 width=128 rotate=180
sudo apt-get install cmake git
and now we have the tools, we can grab the code from github, and build it
cd ~
git clone https://github.com/tasanakorn/rpi-fbcp
cd rpi-fbcp/
mkdir build
cd build/
cmake ..
make
sudo install fbcp /usr/local/bin/fbcp
cd ~
git clone https://github.com/adafruit/Adafruit-Retrogame
cd Adafruit-Retrogame/
make
sudo make install
sudo nano /etc/udev/rules.d/10-retrogame.rules
edit /boot/retrogame.cfg and insert these:
LEFT 5 # Joypad left
RIGHT 26 # Joypad right
UP 6 # Joypad up
DOWN 19 # Joypad down
LEFTCTRL 21 # 'A' button
#LEFTALT 20 # 'B' button
SPACE 16 # 'Select' button
ENTER 20 # 'Start' button
sudo nano /etc/rc.local
insert the following commands
fbcp&
retrogame&
_IP=$(hostname -I) || true
if [ “$_IP” ]; then
printf “My IP address is %s\n” “$_IP”
fi
fbcp&
sudo retrogame&
exit 0
The file we are interested in here is called ‘config.txt’. If you open this file, you will see there are lots of commands and settings here. Scroll to the bottom of the file and add the following lines
dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4
hdmi_force_hotplug=1
hdmi_cvt=128 128 60 1 0 0 0
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
display_rotate=1
if needed change console font size to 6x12 (default 8x16):
sudo dpkg-reconfigure console-setup
references:
https://www.raspberrypi-spy.co.uk/2014/04/how-to-change-the-command-line-font-size/ https://www.waveshare.com/1.44inch-lcd-hat.htm
http://pi0cket.com/guides/tiny-software-for-tinypi/#more-99
https://www.raspberrypi.org/forums/viewtopic.php?t=207627
Comments