Skip to main content

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, 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

Auto Setup

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:

board.colour
board.resolution

Manual Setup

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.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inky-1.1.1.tar.gz (18.5 kB view details)

Uploaded Source

Built Distributions

inky-1.1.1-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

inky-1.1.1-py2-none-any.whl (23.0 kB view details)

Uploaded Python 2

File details

Details for the file inky-1.1.1.tar.gz.

File metadata

  • Download URL: inky-1.1.1.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.3

File hashes

Hashes for inky-1.1.1.tar.gz
Algorithm Hash digest
SHA256 80fff0a201b69890fb37d00d011db6eb487063367d77ad01c06ff9a81a8bdc01
MD5 75a829268b14567d2f10ec784f227248
BLAKE2b-256 73b4130bc107bb2a4db346aa2b767bf35cbd25b3bc2e6b7246c4612849e5ff0e

See more details on using hashes here.

File details

Details for the file inky-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: inky-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.3

File hashes

Hashes for inky-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 911a31bc87f658a8a5f6928deff1894234946d9ef8c423602300b855dacf0783
MD5 b3384b0ec4470e266e4e15b615d7a350
BLAKE2b-256 7f4c3c8afa922f802325802980b6a436bf8f6600d6741c06be28dbf179bbce14

See more details on using hashes here.

File details

Details for the file inky-1.1.1-py2-none-any.whl.

File metadata

  • Download URL: inky-1.1.1-py2-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.3

File hashes

Hashes for inky-1.1.1-py2-none-any.whl
Algorithm Hash digest
SHA256 f86577b6a88768c5f2fef457019ef68f634f073f2d3c28aba751b797c083b755
MD5 aa06dd9324c4c35f057dbf0a1036e5ca
BLAKE2b-256 be788cb56555f740b3408e3a9ad3e523da6e50966d123edf17d2bc6dc1c31409

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page