Inky pHAT Driver
Project description
Inky
Python library for Inky pHAT, Inky wHAT and Inky Impression e-paper displays for Raspberry Pi.
Inky pHAT
Inky pHAT is a 250x122 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 to-do lists, multi-day weather forecasts, bus timetables and more.
Inky Impression
Inky Impression is our line of glorious 7 colour eInk displays, available in 4" (640 x 400 pixel) and 5.7" (600 x 448 pixel) flavours. They're packed with strong colours and perfect for displaying striking graphics or lots of data.
Installation
The Python pip package is named inky, on the Raspberry Pi install with:
pip3 install inky[rpi,fonts]
This will install Inky along with dependencies for the Raspberry Pi, plus fonts used by the examples.
If you want to simulate Inky on your desktop, use:
pip3 install inky
You may need to use sudo pip3
or sudo pip
depending on your environment and Python version.
Usage
The library should be run with Python 3.
Auto Setup
Inky can try to automatically identify your board (from the information stored on its EEPROM) and set up accordingly. This is the easiest way to work with recent Inky displays.
from inky.auto import auto
display = auto()
You can then get the colour and resolution from the board:
display.colour
display.resolution
Manual Setup
If you have an older Inky without an EEPROM, you can specify the type manually. The Inky library contains modules for both the pHAT and wHAT, load the Inky pHAT 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:
display = 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
display = 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.
display.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.
display.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:
display.show()
Migrating
If you're migrating code from the old 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.4.0
- New: inky SSD1683 support for WHAT variant
1.3.2
- BugFix: (ish) handle busy_wait failure cases for UC8159 (Inky Impression)
1.3.1
- BugFix: unbreak UC8159
1.3.0
- New: inky UC8159 support for 4" 640x400 display variant
- BugFix: fix set_image so it doesn't break set_pixel
- New: Added --simulate to "auto()", so auto examples can simulate a chosen board
1.2.2
- BugFix: Raise Impression/7Color/UC8159 busy wait timeout from 15s to 30s
1.2.1
- BugFix: inky high-temp red fix
- Enhancement: SSD1608 (250x122) set_border support
1.2.0
- New: inky impression set_border support
- BugFix: inky impression orange colour
- BugFix: inky impression invalid arg bug for Python 2
- New: inky impression simulator
1.1.1
- Enhancement: drive UC81559 CS with GPIO to avoid conflict with Grow workaround
- Add 7-colour/UC8159 specifics to EEPROM
- BugFix: define UC8159 colour and size constants in class
- BugFix: fix auto to grab args properly, support UC8159 and fallback gracefully
1.1.0
- New: Support for UC8159-based 7-colour 600x448 display
- Enhancement: auto now includes options for fallback
- Enhancement: EEPROM can now give text string for display variant
1.0.2
- Enhancement: Always install Pi dependencies
1.0.1
- Enhancement: Tweak setup.py extras for easier dependency install
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 Distribution
File details
Details for the file inky-1.4.0.tar.gz
.
File metadata
- Download URL: inky-1.4.0.tar.gz
- Upload date:
- Size: 21.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04127b23f80900e165a8f999ef71be932faf392b8405982293e8693239654871 |
|
MD5 | 60f1e7ec3001b6692cdd348176cb99a6 |
|
BLAKE2b-256 | 548870550d74c19a9410d9252ffc4fbc847ac1ae0ec58397bd2a6a825d71a660 |
Provenance
File details
Details for the file inky-1.4.0-py3-none-any.whl
.
File metadata
- Download URL: inky-1.4.0-py3-none-any.whl
- Upload date:
- Size: 28.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 694729e14c58e4fd64bcc97cb4fd40dfe79b5f2578f6ab49cfdf18dd6e620809 |
|
MD5 | 9acf8d6add71637a76476f2ee7c1c102 |
|
BLAKE2b-256 | 07d960d962e0703edd7e6006469f2856914d1ca10b43d9e90477843f50216394 |