Difference between revisions of "Template:12.48e-Paper-connecting-settings"
From Waveshare Wiki
(Created page with " We provide demo codes for four popular hardware platforms, Raspberry Pi, Arduino UNO, STM32 and the ESP32. The product you receive may be pre-assembled, you need to remove th...") |
|||
Line 103: | Line 103: | ||
:[[File:12in48-epaper-rpi-weather1.jpg|400px]][[File:12in48-epaper-rpi-weather2.jpg|400px]] | :[[File:12in48-epaper-rpi-weather1.jpg|400px]][[File:12in48-epaper-rpi-weather2.jpg|400px]] | ||
==Arduino== | ==Arduino== | ||
+ | ===Hardware connection=== | ||
+ | You can directly insert the Arduino UNO to PCB | ||
+ | :[[File:12in48-epaper-Arduinoconne.JPG|800px]] | ||
+ | About the pins used: | ||
+ | :[[File:12in48-epaper-arduino1.png|800px]] | ||
+ | ===Run codes=== | ||
+ | :Download demo codes from wiki and unzio it. | ||
+ | :Copy the 12in48 folder to the libraries directory which is under the installation directory of Arduino IDE.(The installation directory generally is C:\Program Files (x86)\Arduino\libraries) | ||
+ | :Open Ardunin IDE software, choose Tool->Board->Arduino UNO: | ||
+ | :[[File:12in48-epaper-arduino2.png|700px]] | ||
+ | :Click File -> Examples -> EPD12in48 to opem demo cods | ||
+ | :[[File:12in48-epaper-arduino3.png|700px]] | ||
+ | :If your e-Paper is two-color version, use the epd12in48-demo, otherwise, use the epd12in48b-demo | ||
+ | :Compile and download the codes to board | ||
+ | ==STM32== | ||
+ | The development board we use is Waveshare Open103Z. The codes is deveolped based on STM32 HAL libraries. | ||
+ | ===Hardware connection=== | ||
+ | [[File:12in48-epaper-STM32connet.jpg|800px]] |
Revision as of 10:04, 12 November 2019
We provide demo codes for four popular hardware platforms, Raspberry Pi, Arduino UNO, STM32 and the ESP32. The product you receive may be pre-assembled, you need to remove the back panel and connect your device like Raspberry Pi.
Raspberry Pi
Hardware connection
The pins used can be found on schematic according to codes
Enable SPI interface
Open terminal and type command
sudo raspi-config
Choose Interfacing Options -> SPI -> Yes. Then reboot the Raspberry Pi
sudo reboot
Libraries installation
- Install BCM2835
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.60.tar.gz tar zxvf bcm2835-1.60.tar.gz cd bcm2835-1.60/ sudo ./configure sudo make sudo make check sudo make install
- Install wiringPi
sudo apt-get install wiringpi cd /tmp wget https://project-downloads.drogon.net/wiringpi-latest.deb sudo dpkg -i wiringpi-latest.deb gpio -v
- Install python2
sudo apt-get update sudo apt-get install python-pip sudo apt-get install python-pil sudo pip install RPi.GPIO sudo pip install spidev
- Install python3
sudo apt-get update sudo apt-get install python3-pip sudo apt-get install python3-pil sudo pip3 install RPi.GPIO sudo pip3 install spidev
Download
Open terminal and run commands to download codes
sudo apt-get install p7zip-full wget http://www.waveshare.net/w/upload/9/9a/12.48inch_e-Paper_Module_Code_RPI.7z 7z x 12.48inch_e-Paper_Module_Code_RPI.7z -r -o./12.48inch_e-Paper_Module_Code sudo chmod 777 -R 12.48inch_e-Paper_Module_Code cd 12.48inch_e-Paper_Module_Code
Run codes
- C codes
cd c sudo nano examples/main.c
- Confirm that which kind of 12.48inch e-Paper do you use. If you use the two-color display, modify the file as below
- If you use the tree-color display, modify the file as below
- Save then compile and run the code
sudo make clean sudo make sudo ./epd
- Python codes
- Open terminal and run the demo codes by commands:
cd python/examples
- For two-color version
sudo python epd_12in48_test.py
- For three-color version
sudo python epd_12in48_test.py
- Python codes-Weather
cd python/examples
- For two-color display
sudo python Show_EN_Weather.py
- For three-color display
sudo python Show_EN_Weather.py B
- For help information
sudo python Show_EN_Weather.py help
Arduino
Hardware connection
You can directly insert the Arduino UNO to PCB
About the pins used:
Run codes
- Download demo codes from wiki and unzio it.
- Copy the 12in48 folder to the libraries directory which is under the installation directory of Arduino IDE.(The installation directory generally is C:\Program Files (x86)\Arduino\libraries)
- Open Ardunin IDE software, choose Tool->Board->Arduino UNO:
- Click File -> Examples -> EPD12in48 to opem demo cods
- If your e-Paper is two-color version, use the epd12in48-demo, otherwise, use the epd12in48b-demo
- Compile and download the codes to board
STM32
The development board we use is Waveshare Open103Z. The codes is deveolped based on STM32 HAL libraries.