|
6 | 6 | [](https://pypi.python.org/pypi/st7789)
|
7 | 7 |
|
8 | 8 |
|
9 |
| -Python library to control an ST7789 TFT LCD display |
| 9 | +Python library to control ST7789 TFT LCD displays. |
10 | 10 |
|
11 |
| -Designed specifically to work with a ST7789 based 240x240 pixel TFT SPI display. (Specifically the [1.3" SPI LCD from Pimoroni](https://shop.pimoroni.com/products/1-3-spi-colour-lcd-240x240-breakout)). |
| 11 | +Designed to work with the following Pimoroni ST7789 based SPI breakouts and Raspberry Pi HATs: |
12 | 12 |
|
13 |
| - |
| 13 | +- [1.54" SPI Colour Square LCD (240x240) Breakout](https://shop.pimoroni.com/products/1-54-spi-colour-square-lcd-240x240-breakout) |
| 14 | +- [1.3" SPI Colour Square LCD (240x240) Breakout](https://shop.pimoroni.com/products/1-3-spi-colour-lcd-240x240-breakout) |
| 15 | +- [1.3" SPI Colour Round LCD (240x240) Breakout](https://shop.pimoroni.com/products/1-3-spi-colour-round-lcd-240x240-breakout) |
| 16 | +- [Display HAT Mini](https://shop.pimoroni.com/products/display-hat-mini) (2.0" 320x240 LCD) |
| 17 | + |
| 18 | + |
14 | 19 |
|
15 | 20 | # Installation
|
16 | 21 |
|
17 |
| -Make sure you have the following dependencies: |
| 22 | +First, make sure you have the following dependencies: |
18 | 23 |
|
19 |
| -```` |
20 |
| -sudo apt-get update |
21 |
| -sudo apt-get install python-rpi.gpio python-spidev python-pip python-pil python-numpy |
| 24 | +````bash |
| 25 | +sudo apt update |
| 26 | +sudo apt install python-rpi.gpio python-spidev python-pip python-pil python-numpy |
22 | 27 | ````
|
23 | 28 |
|
24 | 29 | Install this library by running:
|
25 | 30 |
|
| 31 | +````bash |
| 32 | +sudo pip3 install st7789 |
26 | 33 | ````
|
27 |
| -sudo pip install st7789 |
28 |
| -```` |
29 | 34 |
|
30 |
| -You might also need to enable I2C and SPI in raspi-config. See example of usage in the examples folder. |
| 35 | +You will also need to make sure I2C and SPI are enabled in raspi-config (`sudo raspi-config`) - you can find them under Interface Options. |
| 36 | + |
| 37 | +# Examples |
| 38 | + |
| 39 | +You can find some examples of use in the examples folder. Clone this repo with: |
| 40 | + |
| 41 | +```bash |
| 42 | +git clone https://github.com/pimoroni/st7789-python |
| 43 | +``` |
| 44 | + |
| 45 | +and navigate into the examples folder with: |
| 46 | + |
| 47 | +```bash |
| 48 | +cd ~/st7789-python/examples/ |
| 49 | +``` |
| 50 | + |
| 51 | +You can pass most of them a parameter (`square`, `rect`, `round`, or `dhmini`) to specify the size/shape/rotation of screen, like this: |
31 | 52 |
|
| 53 | +```bash |
| 54 | +python3 shapes.py dhmini |
| 55 | +``` |
32 | 56 |
|
33 | 57 | # Licensing & History
|
34 | 58 |
|
|
0 commit comments