Skip to content

Commit

Permalink
Update library README
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Aug 12, 2020
1 parent 8194fa0 commit 4b907a8
Showing 1 changed file with 22 additions and 28 deletions.
50 changes: 22 additions & 28 deletions library/README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
Inky
====

|Build Status| |Coverage Status| |PyPi Package| |Python Versions|
`Build Status <https://travis-ci.com/pimoroni/inky>`__ `Coverage
Status <https://coveralls.io/github/pimoroni/inky?branch=master>`__
`PyPi Package <https://pypi.python.org/pypi/inky>`__ `Python
Versions <https://pypi.python.org/pypi/inky>`__

Python library for the `Inky
pHAT <https://shop.pimoroni.com/products/inky-phat>`__ and `Inky
Expand All @@ -12,7 +15,7 @@ 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
yellow/black/white and black/white. Its great for nametags and
displaying very low frequency information such as a daily calendar or
weather overview.

Expand All @@ -21,7 +24,7 @@ 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
yellow/black/white and black/white. Its got tons of resolution for
detailed daily todo lists, multi-day weather forecasts, bus timetables
and more.

Expand All @@ -32,7 +35,7 @@ The Python pip package is named inky, install with:

::

sudo pip install inky
sudo pip install inky

Usage
=====
Expand All @@ -42,36 +45,36 @@ InkyPHAT one as follows:

.. code:: python
from inky import InkyPHAT
from inky import InkyPHAT
You'll then need to pick your colour, one of 'red', 'yellow' or 'black'
Youll then need to pick your colour, one of red’, ‘yellow or black
and instantiate the class:

.. code:: python
inkyphat = InkyPHAT('red')
inkyphat = InkyPHAT('red')
If you're using the wHAT you'll need to load the InkyWHAT class from the
If youre using the wHAT youll need to load the InkyWHAT class from the
Inky library like so:

.. code:: python
from inky import InkyWHAT
inkywhat = InkyWHAT('red')
from inky import InkyWHAT
inkywhat = InkyWHAT('red')
Once you've initialised Inky, there are only three methods you need to
Once youve 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
Set a PIL image, numpy array or list to Inkys internal buffer. The
image dimensions should match the dimensions of the pHAT or wHAT youre
using.

.. code:: python
inkyphat.set_image(image)
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
Expand All @@ -85,36 +88,27 @@ Set the border colour of you pHAT or wHAT.

.. code:: python
inkyphat.set_border(colour)
inkyphat.set_border(colour)
``colour`` should be one of ``inky.RED``, ``inky.YELLOW``,
``inky.WHITE`` or ``inky.BLACK`` with available colours depending on
your diplay type.
your display type.

Update The Display
------------------

Once you've prepared and set your image, and chosen a border colour, you
Once youve prepared and set your image, and chosen a border colour, you
can update your e-ink display with:

.. code:: python
inkyphat.show()
inkyphat.show()
Migrating
=========

If you're migrating code from the ``inkyphat`` library you'll find that
If youre migrating code from the ``inkyphat`` library youll 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()``.

.. |Build Status| image:: https://travis-ci.com/pimoroni/inky.svg?branch=master
:target: https://travis-ci.com/pimoroni/inky
.. |Coverage Status| image:: https://coveralls.io/repos/github/pimoroni/inky/badge.svg?branch=master
:target: https://coveralls.io/github/pimoroni/inky?branch=master
.. |PyPi Package| image:: https://img.shields.io/pypi/v/inky.svg
:target: https://pypi.python.org/pypi/inky
.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/inky.svg
:target: https://pypi.python.org/pypi/inky

0 comments on commit 4b907a8

Please sign in to comment.