• sales

    +86-0755-88291180

8. Backlight control User Guide

Backlight control

After CPU Info LCD screen is correctly inserted into the Raspberry Pi, you need to compile and run the program to display it normally.

This experiment controls the backlight effect through the program: the backlight will flash every 0.5 seconds.

1. Welding The BL_JMP of 1.6 LCD

!!!Note: Before welding BL_JMP, you must turn BackLight Swith to OFF. Otherwise, when GPIO7 outputs high level (3.3V), it will cause a short circuit. Because the short circuit current is too large, it is likely to burn out the Raspberry Pi and the display.

Therefore, users who need to use software to control the backlight effect will turn the switch to the OFF position in reverse order.


2. Install the wringPi library

CPU Info LCD screen is used for data communication through the GPIO port of the Raspberry Pi, so we must install the wiringPi library file.

Enter the following command to install the wringPi library. Users who have already installed the wiringPi library can ignore this step.

cd ~

git clone git://git.drogon.net/wiringPi

cd wiringPi

./build

3.Install Drive

1) Transfer the driver file to the Raspberry Pi

You need to install the Winscp tool on your computer. After connecting to the Raspberry Pi, transfer the cpu_show_BL.zip package from this folder to the pi directory of the Raspberry Pi.

As shown blew, drag and drop cpu_show_BL.zip directly into the Raspberry Pi system.


2 )Extract file

Open the Raspberry Pi terminal and find the cpu_show_BL.zip file.

Enter command:

ls 


Enter command:

unzip cpu_show_BL.zip


3) Enter the program folder

cd  ~/cpu_show_BL

ls


4)  Compile file

Enter command:

gcc -o bl bl.c PCD8544.c -lwiringPi


5) Running procedure

Enter command:

./bl


The Raspberry Pi icon is displayed on the CPU Info screen and the backlight flashes every 0.5s 


4.Code analysis

Enter command:

nano bl.c

This command is to open bl.c

1) The following sections are the LCD pin settings:


2)Main function


3)The front part is the initialization program and the prompt information; the latter part is a for loop.


Note: If you have added a boot-up user, first move the xx.desktop file displayed on the 1.6-inch screen in the /home/pi/.config/autostart folder to the pi directory.

If you do not close a program that has already been run, the screen will always change due to conflicts after the program runs.

For example, there is a file driver.desktop that drives a 1.6-inch screen in the /home/pi/.config/autostart folder.


We need to move start.desktop to the pi directory:

Enter command:

mv /home/pi/.config/autostart/start.desktop  /home/pi

Then we can enter command:

sudo reboot

This command is to restart the Raspberry Pi. 

TAG: ESP32-S3 0.85inch LCD Accelerometer DPI Interface Raspberry Pi Pico 2 RP2350 1.28 inch Round LCD Development Board 240x240 Display Screen QMI8658 6-Axis ISX031C GMSL Camera H100 Image Sensor IP67 protection rating For Jetson Orin And MAX9296 GMSL camera 1.28 inch Round Rotary LCD Smart Screen 1.28inch Knob Display 240x240 Option Touch/No-Touch 7.5 inch Passive NFC e-Paper BW Display 7.5inch E-ink Screen No Need Battery Wireless Powered Data Transfer Raspberry Pi 5 PCIe to 4-CH M.2 NVMe 4-Ports SSD Board HAT Pi5 Four-Times spotpear Raspberry Pi 18.5 inch Type C/HDMI/4K Display Screen 3840×2160 Computer PC Phone Xbox/PS4/Switch Raspberry Pi Camera Raspberry Pi MLX90640 1.47 inch LCD AXS5106L TouchScreen JD9853 Display 172x320 For Arduino/Raspberry Pi/Pico/ESP32 Intel 12th LoRa32-Heltec V4 ESP32-S3 LoRa SX1262 Development Board 863-928MHz Meshtastic For Arduino ESP32-S3 2.16inch AMOLED Display AI Development Board 480×480 2.16 inch TouchScreen Deepseek USB IR Infrared Thermal Imaging Camera C 45°/88° 160x120 For Phone/PC High Temp Warning/Take Photo /Recording video Computer AI Deepseek Mechanical Voice Keyboard Linux 10x0.85inch LCD Screen Customize keys + 2.01 inch Secondary Display Raspberry Pi AI HAT+ Official Original Hailo-8/8L 13/26Tops For Pi5 PCIe M.2 Gen3 ESP32-S3 1.14inch LCD