Skip to content

Instantly share code, notes, and snippets.

@CandleHater
Last active February 8, 2020 12:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CandleHater/b3010b2b68d04db8d2c222080d1f8d07 to your computer and use it in GitHub Desktop.
Save CandleHater/b3010b2b68d04db8d2c222080d1f8d07 to your computer and use it in GitHub Desktop.
Raspberry Display Installation & Wiring on Raspbian for Python3

LED Matrix, MAX7219 & RGB NeoPixels (WS2812/APA102)

Installation

# SPI
sudo raspi-config nonint do_spi 0
sudo reboot

# packages
sudo apt install -y git build-essential python-dev python-pip libfreetype6-dev libjpeg-dev libopenjp2-7 libtiff5
sudo -H pip3 install --upgrade luma.led_matrix

# examples
git clone https://github.com/rm-hull/luma.led_matrix
cd luma.led_matrix/examples

TFT

ST7789/ST7789VW

# SPI
sudo raspi-config nonint do_spi 0
sudo reboot

# packages
sudo apt install -y git wiringpi python3-pip python3-spidev python3-numpy python3-pil

# [option 1] has SPI CS pin
sudo pip3 install st7789

# [option 2] without SPI CS pin
git clone https://github.com/solinnovay/Python_ST7789.git
cd Python_ST7789
sudo pip3 install .

eInk

Waveshare

Wiring (BCM)

VCC    ->    3.3
GND    ->    GND
DIN    ->    10 (SPI0_MOSI)
CLK    ->    11 (SPI0_SCK)
CS     ->    8 (SPI0_CS0)
DC     ->    25
RST    ->    17
BUSY   ->    24

Installation

# SPI
sudo raspi-config nonint do_spi 0
sudo reboot

# packages
sudo apt install -y git wiringpi python3-pip python3-spidev python3-numpy python3-pil 
pip3 install RPi.GPIO spidev

# [Raspberry Pi 4 only] needs latest version of WiringPi
cd /tmp
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb

# BCM2835
cd /tmp
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.60.tar.gz
tar zxvf bcm2835-1.60.tar.gz 
cd bcm2835-1.60/
./configure
sudo make
sudo make check
sudo make install

# python
cd ~
git clone https://github.com/waveshare/e-Paper
cd ~/e-Paper/RaspberryPi*/python/
python3 setup.py install

# test
cd ~/e-Paper/RaspberryPi*/python/examples
python3 epd_2in13d_test.py # adjust the "2in13d" part to your size

PaPiRus

curl -sSL https://pisupp.ly/papiruscode | sudo bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment