Browse our Blog. You will find multiple applications, solutions, code examples. Navigate using the tag cloud or search using specific criteria
1.28" LCD Display Module & Raspberry Tutorial
1.28" round LCD display module from WaveShare is a module with an embedded GC9A01 driver, 65K RGB colors, 240x240 Resolution and using SPI bus and interface. Minimizes required IO pins., supports controller boards like Raspberry Pi/Jetson Nano/Arduino/STM32 and comes with development resources, like examples for Raspberry Pi, Arduino and STM32.
In this blog we are going to display sample pictures in out 1.28"round LCD Display Module.
- Raspberry Pi
- 1.28inch LCD module from WaveShare
- Either HDMI cable or Ethernet cable to connect to your Raspberry Pi
Serial Peripheral Interface (SPI) is an interface bus commonly used to send data between microcontrollers and small peripherals such as shift registers, sensor, and SD cards. It uses separate clock and data lines, along with a select line to choose the device you wish to talk to. In the picture below you can see a single master and a single slave on a Serial Peripheral Interface (SPI) bus.
First of all, connect your Raspberry Pi and 1.28" LCD module as shown in the picture below.
Enable SPI interface
Then, power up your Raspberry Pi and connect through Ethernet or HDMI. In our case, we are going to connect through SSH:
Run the following command to enter the configuration page
Enable the SPI interface. Go to:
Interfacing Options > SPI > Yes,
Reboot your Raspberry Pi:
Extract the files.
tar zxvf bcm2835-1.68.tar.gz
Change to the bcm2835-1.68 directory.
Run the configure script and compile.
sudo ./configuresudo makesudo make checksudo make install
sudo apt install wiringpi
For the version of the Raspberry Pi system after May 2019 an upgrade may be required.
wget https://project-downloads.drogon.net/wiringpi-latest.deb sudo dpkg -i wiringpi-latest.deb gpio -v
Install Python libraries. Install the one that fits with your Raspberry version.
#python2 sudo apt-get update sudo apt-get install python-pip sudo apt-get install python-pil sudo apt-get install python-numpy sudo pip install RPi.GPIO sudo pip install spidev
#python3 sudo apt-get update sudo apt-get install python3-pip sudo apt-get install python3-pil sudo apt-get install python3-numpy sudo pip3 install RPi.GPIO sudo pip3 install spidev
Run the following commands to install p7zip-full package
sudo apt-get install p7zip-full
Download the demo codes
sudo wget https://www.waveshare.net/w/upload/a/a8/LCD_Module_RPI_code.7z
Extract the files
7z x LCD_Module_RPI_code.7z -O./LCD_Module_code
Change to RaspberryPi directory
Go to the LCD_Module_code/RaspberryPi/c directory and re-compile the demo codes
sudo make clean
sudo make -j 8
Waveshare code examples are made for multi-display. So you can input the type of LCD when using. In our case, we are going to run the command according to our 1.28inch LCD module.
sudo ./main 1.28
To run the Raspberry demo examples, go to the directory demo examples from python:
Likewise as with the C codes, these examples are made for multi-display, so you can also run the examples for different modules. In our case, if you have Python version 2, run the following:
sudo python 1inch28_LCD_test.py
In case of Python3, run the following command:
sudo python3 1inch28_LCD_test.py
If everything went fine, congratulations! You managed to get the sample application running!