Inky pHAT Driver
Project description
Inky
Build Status Coverage Status PyPi Package Python Versions
Python library for the Inky pHAT and Inky wHAT e-paper displays.
Inky pHAT
Inky pHAT is a 212x104 pixel e-paper display, available in red/black/white, yellow/black/white and black/white. It’s great for nametags and displaying very low frequency information such as a daily calendar or weather overview.
Inky wHAT
Inky wHAT is a 400x300 pixel e-paper display available in red/black/white, yellow/black/white and black/white. It’s got tons of resolution for detailed daily todo lists, multi-day weather forecasts, bus timetables and more.
Installation
The Python pip package is named inky, install with:
sudo pip install inky
Usage
The Inky library contains modules for both the pHAT and wHAT, load the InkyPHAT one as follows:
from inky import InkyPHAT
You’ll then need to pick your colour, one of ‘red’, ‘yellow’ or ‘black’ and instantiate the class:
inkyphat = InkyPHAT('red')
If you’re using the wHAT you’ll need to load the InkyWHAT class from the Inky library like so:
from inky import InkyWHAT
inkywhat = InkyWHAT('red')
Once you’ve initialised Inky, there are only three methods you need to be concerned with:
Set Image
Set a PIL image, numpy array or list to Inky’s internal buffer. The image dimensions should match the dimensions of the pHAT or wHAT you’re using.
inkyphat.set_image(image)
You should use PIL to create an image. PIL provides an ImageDraw module which allow you to draw text, lines and shapes over your image. See: https://pillow.readthedocs.io/en/stable/reference/ImageDraw.html
Set Border
Set the border colour of you pHAT or wHAT.
inkyphat.set_border(colour)
colour should be one of inky.RED, inky.YELLOW, inky.WHITE or inky.BLACK with available colours depending on your display type.
Update The Display
Once you’ve prepared and set your image, and chosen a border colour, you can update your e-ink display with:
inkyphat.show()
Migrating
If you’re migrating code from the inkyphat library you’ll find that much of the drawing and image manipulation functions have been removed from Inky. These functions were always supplied by PIL, and the recommended approach is to use PIL to create and prepare your image before setting it to Inky with set_image().
1.0.0
New: Support for SSD1608-based displays
New: Mock Inky pHAT and wHAT displays
New: Automatic Inky detection and class constructor
Enhancement: Support for alternate i2c_bus when reading eeprom
Enhancement: Support for alternate spi_bus
Enhancement: Support for alternate GPIO driver
Enhancement: Replaced sys.exit calls with ImportError
Enhancement: Improved docstrings
0.0.5
Enhancement: Added support for red/b/w high-temp Inky wHAT
0.0.4
BugFix: Reverted normal red LUTs to correct values
0.0.3
Enhancement: Added support for display variant detection
Enhancement: Added DocStrings
BugFix: Fixed set_border for all colours
0.0.2
BugFix: Yellow Inky pHAT now yellow instead of brown/black
Enhancement: Performance tweak for set_image
0.0.1
Initial Release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file inky-1.0.0.tar.gz
.
File metadata
- Download URL: inky-1.0.0.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ab2125839763177c8da4abaaa983713a00173bbc28c330a686dd435952e73c5 |
|
MD5 | 90e8425426a8e639cdd36f8b481f7f24 |
|
BLAKE2b-256 | e84027184eb18257759274a000ebbc1d138289583840cc5bc60759a48d654b47 |
File details
Details for the file inky-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: inky-1.0.0-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f1ca15eb351f37efefdd68709a37fafbac5e3d1f3fa12c87deecae9d634a242 |
|
MD5 | 520c2d842e8fa2c01b4de0a636e56d08 |
|
BLAKE2b-256 | 81cb99144cf6c42221a1e56e9d5e2bc0ebd390a89844b414bd28829113a72709 |
File details
Details for the file inky-1.0.0-py2-none-any.whl
.
File metadata
- Download URL: inky-1.0.0-py2-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b0ff82fec7c0e9fd20c1d9fadc65414bd7eaf3e30c80fdc790f576582986ab8 |
|
MD5 | e9d15ce900de3b9f09e67afe722b9691 |
|
BLAKE2b-256 | edf28d2d4c7fd5e3603f291bed461aff4980d5ae1eb6b421cb9a481cf4387f83 |