• sales

    +86-0755-88291180

6. Dispaly Raspberry pi lP User Guide

Dispaly Raspberry pi lP

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 is used to display IP address of the Raspberry Pi.

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

2.Install Drive

2.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_ip.zip package from this folder to the pi directory of the Raspberry Pi.

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


2.2 Extract file

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

Enter command:

ls 


Enter command:

unzip cpu_show_ip.zip


2.3  Enter the program folder

cd  ~/cpu_show_ip

ls


2.4 Compiler file

Enter command:

cc -o cpushow_ip pcd8544_rpi.c PCD8544.c  -L/usr/local/lib -lwiringPi


cc is the compile command, -o is the compile parameter, cpushow_temp is the generated program name, pcd8544_rpi.c and PCD8544.c are the source files in the current directory, -L/usr/local/lib and -lwiringPi are referenced libraries file.

2.5 Running procedure

Enter command:

sudo ./cpushow_ip


The system will prompt “Raspberry Pi PCD8544 sysinfo display” and display the following on the CPU Info screen.


3. Code analysis

Enter command:

nano pcd8544_rpi.c

This command is to open pcd8544_rpi.c

1) The following sections are the pin settings and the header files needed to get the IP address.

 

2) Main function


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


4) 
Get IP address

Enter command:

nano PCD8544.c


Sprintf(IPInfo, "%s", addressBuffer); The function is a splicing function that replaces the value of addressBuffer with the %d position and saves it to IPInfo.

5) LCD display content


The LCDdrawstring(0, 1, "Hello YahBoom!") function represents display “Hello YahBoom!” from the first column and the second line.

The first parameter: 0, which means starting from the first column on the left, The second parameter: 1, representing the second line from the top,

The third parameter: "hello YahBoom!", which represents the data to be displayed.

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: NVIDIA Jetson Xavier NX AI 21TOPS Supercomputer Edge Computing eMMC-16GB RAM 8/16GB Raspberry Pi Fisheye Camera IMX378 12.3MP 190° Wide Angle Roller shutter ESP32 S3 Development Board 1.43 inch AMOLED Display 1.43inch TouchScreen For Arduino LVGL With SD-Port/ QMI8658C 6-Axis Sensor Raspberry Pi 5 PD Trigger Raspberry Pi Camera OV5647 Camera (F) Raspberry Pi Pico Electronic EYE 0.71inch Round LCD Display Screen For Arduino Raspberry Pi ESP32 Pico STM32 Jetson Orin Nano Super AI Developer Kit Built in Jetson Orin Nano 8GB Memory Core board Raspberry Pi 5 ABS Case Raspberry Pi 10.1 inch DSI MIPI LCD TouchScreen Display 10.1inch 720x1280 For Luckfox Lyra RK3506/ESP32-P4/Luckfox Omni3576 ESP32 C3 ESP32 1.54 inch E-Paper Smart Watch display Screen 200x200 Ultra-low power For Arduino/Micropython/RTOS For Watchy Jetson Nano Development Kit JETSON-NANO-DEV-KIT Replace For Jetson-Nano-Developer-Kit-B01 ESP32-C5 3.5inch LCD For Xiaozhi AI Development Board Display 320×480 3.5 inch TouchScreen Camera STM32 downloader DeepSeek AI Voice Chat ESP32 Development Board 3.5 inch TouchScreen Display 320x480 Raspberry Pi 15.6 inch QLED Quantum Dot Display 1920x1080 Capacitive Touchscreen For Computer PC/Jetson/Game $167.99 Raspberry Pi RTC WatchDog HAT (B) Real time clock Onboard DS3231SN High Precision RTC Chip NVIDIA Jetson Orin Nano 4/8GB AI 20/40Tops Lower Power Autonomous Machines Servo PWM motor WP5320 WP5335 35/20KG.CM 180° PWM digital servo double ball bearings