Main Content

Orange  Pi One and ST7735 TFT 1.77"

STEP 1
You need to install luma.LCD library. Type following command in terminal.sudo -H pip3 install —upgrade luma.lcd
If you are using older versions of python like 2.7 type pip instead of pip3. All additional info is in documentation in the link below
Git :https://github.com/rm-hull/luma.lcd
Documentation: https://luma-lcd.readthedocs.io/en/latest/install…
I also recommend installing luma.example so you can test it on first startup or see some ideas for display usage . Git: https://github.com/rm-hull/luma.examples
Install OranpePi.GPIO because we need to import it in library (STEP 3)pypi: https://pypi.org/project/OrangePi.GPIO
STEP 2
Lets connect display to orange pi one
Following setup is different from one in luma.LCD documentation(those are optimased for Raspberry Pi)
_ _LCD Pin~~~~~~~~~~~~~~~Remarks~~~~~~~~~~~~~~~OPi Pin_ _1 GND~~~~~~~~~~~~~~~~Ground ~~~~~~~~~~~~~~~~P01~06_ _2 VCC~~~~~~~~~~~~~~~~+5V Power~~~~~~~~~~~~~~P01~04_ _3 SCK or CLK~~~~~~~~~~SPI clock~~~~~~~~~~~~~~~P01~23_ _4 SDA or DIN~~~~~~~~~~ SPI data~~~~~~~~~~~~~~~P01~19_ _5 RESET or RST~~~~~~~~Reset~~~~~~~~~~~~~~~~~P01~18_ _6 A0,D/C or RS~~~~~~~~~Data/command~~~~~~~~~~P01~16_ _7 CS~~~~~~~~~~~~~~~~~SPI chip select~~~~~~~~~~P01~24_ _8 LEDA~~~~~~~~~~~~~~~Backlight 3.3V~~~~~~~~~~P01~01_ _
STEP 3
Navigate to
/usr/local/lib/python3.7/dist-packages/luma/core/lib.py
and on line 23 replace import RPi.GPIO as GPIO with
import OPi.GPIO as GPIOthen below that add line
GPIO.setboard(4)
where number 4 represents orange pi one board
list of supported boards:
https://github.com/Jeremie-C/OrangePi.GPIO/blob/ma…
After that write your code to test or if you installed luma.examples start some of themNOTE if you run example from luma.examples you have to import your display (st7735) instead of “get_device” and to define it
For example:
from luma.lcd.device import st7735
from luma.core.interface.serial import spi
serial = spi(port=0, device=0, gpio_DC=23, gpio_RST=24)
device = st7735(serial, rotate = 1)
Thats it! I hope i saved your time in researching.”

Link to article