Raspberry Pi (9) Waveshare 2.13inch e-Paper HAT
経緯
低消耗電力、停電でも表示する e-Paperが興味があり、そのRaspberry Pi HATを手に入れた。
ハードウェア
このRaspberry Pi Waveshare 2.13inch e-Paper HATは、Raspberry Pi 2/3/Zero対応する。
ソフトウェア
wiringpiのインストール
root@raspberrypizero004:/home/pi# pip3 search wiringpi
wiringpi (2.46.0) – A python interface to WiringPi 2.0 library which allows for easily
interfacing with the GPIO pins of the Raspberry Pi. Also supports i2c and
SPI.
wiringpi2 (2.32.3) – A python interface to WiringPi 2.0 library which allows for easily
interfacing with the GPIO pins of the Raspberry Pi. Also supports i2c
and SPI
root@raspberrypizero004:/home/pi# pip3 install wiringpi
wiringpi (2.46.0) – A python interface to WiringPi 2.0 library which allows for easily
interfacing with the GPIO pins of the Raspberry Pi. Also supports i2c and
SPI.
wiringpi2 (2.32.3) – A python interface to WiringPi 2.0 library which allows for easily
interfacing with the GPIO pins of the Raspberry Pi. Also supports i2c
and SPI
root@raspberrypizero004:/home/pi# pip3 install wiringpi
root@raspberrypizero004:/home/pi# gpio -v
gpio version: 2.46
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty
gpio version: 2.46
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty
動作確認する
Raspberry Pi Details:
Type: Pi Zero-W, Revision: 01, Memory: 512MB, Maker: Sony
* Device tree is enabled.
*–> Raspberry Pi Zero W Rev 1.1
* This Raspberry Pi supports user-level GPIO access.
root@raspberrypizero004:/home/pi#
Type: Pi Zero-W, Revision: 01, Memory: 512MB, Maker: Sony
* Device tree is enabled.
*–> Raspberry Pi Zero W Rev 1.1
* This Raspberry Pi supports user-level GPIO access.
root@raspberrypizero004:/home/pi#
Python関連のインストール
28 sudo apt-get install python-dev
29 sudo apt install python-rpi.gpio
30 sudo apt install python-smbus
31 sudo apt install python-serial
32 sudo apt install python-spidev
33 sudo apt install python-imaging
34 sudo raspi-config
29 sudo apt install python-rpi.gpio
30 sudo apt install python-smbus
31 sudo apt install python-serial
32 sudo apt install python-spidev
33 sudo apt install python-imaging
34 sudo raspi-config
35 sudo vi /etc/modules
下記の2行を追加する
i2c-bcm2708
i2c-dev
i2c-dev
検証
demo codeのダウンロードと解凍
36 wget https://www.waveshare.com/w/upload/3/3f/2.13inch-e-paper-hat-b-code.7z
39 sudo apt install p7zip-full
62 mkdir 2.13inch-e-paper-hat-b-code
63 cd 2.13inch-e-paper-hat-b-code/
64 7z x ../2.13inch-e-paper-hat-b-code.7z
65 ls
39 sudo apt install p7zip-full
62 mkdir 2.13inch-e-paper-hat-b-code
63 cd 2.13inch-e-paper-hat-b-code/
64 7z x ../2.13inch-e-paper-hat-b-code.7z
65 ls
pythonで試す
66 python raspberrypi/python/main.py
71 cd raspberrypi/
73 cd python/
75 python main.py
71 cd raspberrypi/
73 cd python/
75 python main.py
wiringpiで試す
76 cd ..
79 cd wiringpi/
81 make
85 ./epd
79 cd wiringpi/
81 make
85 ./epd
参考
- http://www.waveshare.net/wiki/2.13inch_e-Paper_HAT_(B)
- https://relativelayout.hatenablog.com/entry/2018/02/17/234348 — Waveshare 2.13inch e-Paper HAT (B)を買って3色電子ペーパーを楽しむ(環境構築編)