Connect LCD Screen to Raspberry Pi¶
Sometimes, we want to use Raspberry Pi where a full-size monitor is not convenient, therefore, connecting the pi to a portable LCD screen is one reasonable work-around.
Installation¶
Plug in the Screen¶
Enable SPI¶
In raspi-config -> interfacing options -> SPI -> enable
Clone LCD driver from Github¶
Clone github repository and change the privilege.
git clone https://github.com/goodtft/LCD-show.git
chmod -R 755 LCD-show
cd LCD-show
Switch the Output to LCD screen¶
Run the command based on the Pi version and screen size
# 2.4” RPi Display (MPI2401)
sudo ./LCD24-show
# 2.4” RPi Display For RPi 3A+ (MPI2411)
sudo ./LCD24-3A+-show
# 2.8” RPi Display (MPI2801):
sudo ./LCD28-show
# 3.2” RPi Display (MPI3201):
sudo ./LCD32-show
# MHS-3.2” RPi Display (MHS3232):
sudo ./MHS32-show
# 3.5” RPi Display(MPI3501):
sudo ./LCD35-show # what we have in the lab
# 3.5” HDMI Display-B(MPI3508):
sudo ./MPI3508-show
# MHS-3.5” RPi Display(MHS3528):
sudo ./MHS35-show
Switch the Output to LCD screen¶
Switch back to hdmi
sudo ./LCD-hdmi
Useful Applications¶
Print Hostname and IP address on the LCD¶
#!/bin/bash
IP=`ifconfig wlan0 | grep -oP '(?<=inet )(\d+\.){3}\d+'`
notify-send "$IP"