Inky pHAT Driver
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 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.
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.
The library should be run with python 3
Inky can try to automatically detect your board and set up accordingly:
from inky.auto import auto board = auto()
You can then get the colour and resolution from the board:
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 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.
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 the border colour of you pHAT or wHAT.
colour should be one of
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:
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
- inky impression set_border support
- fix inky impression orange colour
- fix inky impression ivnalid arg bug for Python 2
- add inky impression simulator
- 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
- 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
- Enhancement: Always install Pi dependencies
- Enhancement: Tweak setup.py extras for easier dependency install
- 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
- Enhancement: Added support for red/b/w high-temp Inky wHAT
- BugFix: Reverted normal red LUTs to correct values
- Enhancement: Added support for display variant detection
- Enhancement: Added DocStrings
- BugFix: Fixed set_border for all colours
- BugFix: Yellow Inky pHAT now yellow instead of brown/black
- Enhancement: Performance tweak for set_image
- Initial Release
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size inky-1.2.0-py3-none-any.whl (23.8 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size inky-1.2.0.tar.gz (20.2 kB)||File type Source||Python version None||Upload date||Hashes View|