Orange Pi One and ST7735 TFT 1.77"

Introduction: 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 GPIO
then 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 them
NOTE 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.

Be the First to Share

    Recommendations

    • Fruit and Veggies Speed Challenge

      Fruit and Veggies Speed Challenge
    • Summer Fun: Student Design Challenge

      Summer Fun: Student Design Challenge
    • Maps Challenge

      Maps Challenge

    Comments