CircuitPython displayio library for ST7565 and ST7567 controllers, based on the original framebuf implementation.
As a community effort, this library was tested with only one ST7567 display and may be not fully compatible with other hardware.
This driver depends on:
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.
Note
This library is not available on PyPI yet. Install documentation is included as a standard element. Stay tuned for PyPI availability!
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:
pip3 install circuitpython-displayio-st7565
To install system-wide (this may be required in some cases):
sudo pip3 install circuitpython-displayio-st7565
To install in a virtual environment in your current project:
mkdir project-name && cd project-name
python3 -m venv .venv
source .env/bin/activate
pip3 install circuitpython-displayio-st7565
Make sure that you have circup
installed in your Python environment.
Install it with the following command if necessary:
pip3 install circup
With circup
installed and your CircuitPython device connected use the
following command to install:
circup install displayio_st7565
Or the following command to update an existing version:
circup update
import board
import busio
import displayio
import terminalio
from adafruit_display_text import label
import displayio_st7565
# Compatibility with both CircuitPython 8.x.x and 9.x.x.
# Remove after 8.x.x is no longer a supported release.
try:
from fourwire import FourWire
except ImportError:
from displayio import FourWire
displayio.release_displays()
spi = busio.SPI(board.GP18, board.GP19)
display_bus = FourWire(
spi, command=board.GP20, chip_select=board.GP17, reset=board.GP21, baudrate=1000000
)
display = displayio_st7565.ST7565(display_bus, width=128, height=64)
splash = displayio.Group()
display.root_group = splash
text = "Hello World!"
text_area = label.Label(terminalio.FONT, text=text, color=0xFFFFFF, x=0, y=8)
splash.append(text_area)
while True:
pass
API documentation for this library can be found on Read the Docs.
For information on building library documentation, please check out this guide.
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.