Raspberry Pi 5110 Mini LCD 84*48 PCD8544 Usage

From Wiki
Revision as of 02:58, 6 July 2016 by Root (Talk | contribs)

Jump to: navigation, search

Introduction

With a resolution of 84 * 48, this Mini LCD screen display the CPU utilization and the memory occupancy rate that runs on your Raspberry Pi through Raspberry Pi internal Python programming. It is clear at a glance.
Of course, geek players can also program by themselves to display any content. this Mini LCD screen is with backlit. When the Raspberry Pi is used as a server, you can also see the operation condition of Raspberry Pi at night.
Mini LCD screen is compatible with Raspberry Pi Model B+ and B.
5110display.png

For C User

If you are a C user, please test and use PCD8544 LCD according to the following steps:

Step1: Install wiringPi

cd /home
git clone git://git.drogon.net/wiringPi
cd wiringPi
sudo ./build

Step 2: Copy cpu_show.tar.gz to /home and extract it

cp yourpath/cpu_show.tar.gz /home
tar xvf cpu_show.tar.gz

Step 3: Compile files

cd /home/cpu_show
sudo ./compile

Step 4: Run the program

sudo ./cpushow

NOTE: Due to the contrast of each LCD are different, if you found the content displayed too dark or too light, you need to modify the contrast variables of pcd8544_rpi.c, and then recompile and run to see the effect of changes !

vim pcd8544_rpi.c

Modify the line 52, int contrast = 45;
45 is the default contrast, if the character LCD display is too light, set this value increases, decreases if the character LCD display is too dark. Recommended stepping value is 5. After the changes are complete, re-compile the code, and then run.

For Python User

If you are a Python user, please test PCD8544 LCD according to the following steps:

Step 1: Download example code

git clone https://github.com/adafruit/Adafruit_Nokia_LCD.git

Step 2: Configure the base environment

cd Adafruit_Nokia_LCD
sudo apt-get install python-dev
sudo python setup.py install
sudo apt-get install python-imaging

Step 3: Modify example code

cd examples

Since our PCD8544 LCD display does not use the hardware SPI interface of Raspberry Pi, so we use software to simulate SPI so as to drive PCD8544. The example code is based on hardware SPI. As a result, we need to make a few modifications to example code to drive PCD8455 LCD.

vim image.py

The modified code is as follows:
Pcd8544 IDE0127.png

Step 4: Run the Python program just modified

sudo python image.py

Press Enter, you should see a cat displayed on PCD8544 LCD.
Also you can modify these two files of animate.py and shapes.py exactly in the same way as image.py.Run and check the result.
Pas.png

Resource

PCD8544 datasheetPDF.jpg
Cpu_showZIP.jpg