Skip to content

Commit

Permalink
Prep for v1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Dec 24, 2021
1 parent 26041ad commit 4e1005b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 19 deletions.
5 changes: 5 additions & 0 deletions library/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.3.1
-----

* BugFix: unbreak UC8159

1.3.0
-----

Expand Down
38 changes: 21 additions & 17 deletions library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,30 @@
[![PyPi Package](https://img.shields.io/pypi/v/inky.svg)](https://pypi.python.org/pypi/inky)
[![Python Versions](https://img.shields.io/pypi/pyversions/inky.svg)](https://pypi.python.org/pypi/inky)

Python library for the [Inky pHAT](https://shop.pimoroni.com/products/inky-phat) and [Inky wHAT](https://shop.pimoroni.com/products/inky-what) e-paper displays.
Python library for [Inky pHAT](https://shop.pimoroni.com/products/inky-phat), [Inky wHAT](https://shop.pimoroni.com/products/inky-what) and [Inky Impression](https://shop.pimoroni.com/?q=inky+impression) e-paper displays for Raspberry Pi.

## Inky pHAT

[Inky pHAT](https://shop.pimoroni.com/products/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 pHAT](https://shop.pimoroni.com/products/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](https://shop.pimoroni.com/products/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.
[Inky wHAT](https://shop.pimoroni.com/products/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](https://shop.pimoroni.com/?q=inky+impression) is our line of glorious 7 colour eInk displays, available in [4"](https://shop.pimoroni.com/products/inky-impression-4) (640 x 400 pixel) and [5.7"](https://shop.pimoroni.com/products/inky-impression-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,example-depends]
pip3 install inky[rpi,fonts]
```

This will install Inky along with dependencies for the Raspberry Pi, plus modules used by the examples.
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:

Expand All @@ -36,27 +40,27 @@ You may need to use `sudo pip3` or `sudo pip` depending on your environment and

# Usage

The library should be run with python 3
The library should be run with Python 3.

## Auto Setup

Inky can try to automatically detect your board and set up accordingly:
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.

```python
from inky.auto import auto
board = auto()
display = auto()
```

You can then get the colour and resolution from the board:

```python
board.colour
board.resolution
display.colour
display.resolution
```

## Manual Setup

The Inky library contains modules for both the pHAT and wHAT, load the InkyPHAT one as follows:
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:

```python
from inky import InkyPHAT
Expand All @@ -65,14 +69,14 @@ from inky import InkyPHAT
You'll then need to pick your colour, one of 'red', 'yellow' or 'black' and instantiate the class:

```python
inkyphat = InkyPHAT('red')
display = InkyPHAT('red')
```

If you're using the wHAT you'll need to load the InkyWHAT class from the Inky library like so:

```python
from inky import InkyWHAT
inkywhat = InkyWHAT('red')
display = InkyWHAT('red')
```

Once you've initialised Inky, there are only three methods you need to be concerned with:
Expand All @@ -82,7 +86,7 @@ Once you've initialised Inky, there are only three methods you need to be concer
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.

```python
inkyphat.set_image(image)
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
Expand All @@ -92,7 +96,7 @@ You should use `PIL` to create an image. `PIL` provides an `ImageDraw` module wh
Set the border colour of you pHAT or wHAT.

```python
inkyphat.set_border(colour)
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.
Expand All @@ -102,10 +106,10 @@ inkyphat.set_border(colour)
Once you've prepared and set your image, and chosen a border colour, you can update your e-ink display with:

```python
inkyphat.show()
display.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()`.
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()`.
2 changes: 1 addition & 1 deletion library/inky/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .inky_uc8159 import Inky as Inky7Colour # noqa: F401
from .auto import auto # noqa: F401

__version__ = '1.3.0'
__version__ = '1.3.1'

try:
from pkg_resources import declare_namespace
Expand Down
2 changes: 1 addition & 1 deletion library/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

setup(
name='inky',
version='1.3.0',
version='1.3.1',
author='Philip Howard',
author_email='[email protected]',
description='Inky pHAT Driver',
Expand Down

0 comments on commit 4e1005b

Please sign in to comment.