Skip to content

Commit

Permalink
Merge c768751 into b68ff46
Browse files Browse the repository at this point in the history
  • Loading branch information
ageeandakeyboard committed Feb 6, 2023
2 parents b68ff46 + c768751 commit 00ca3b8
Show file tree
Hide file tree
Showing 17 changed files with 696 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Python library for [Inky pHAT](https://shop.pimoroni.com/products/inky-phat), [I

## 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.
[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) [5.7"](https://shop.pimoroni.com/products/inky-impression-5-7) (600 x 448 pixel) and [7.3"](https://shop.pimoroni.com/products/inky-impression-7-3) (800 x 480 pixel) flavours. They're packed with strong colours and perfect for displaying striking graphics or lots of data.

# Installation

Expand Down
7 changes: 3 additions & 4 deletions examples/7color/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import io

from PIL import Image
from inky.inky_uc8159 import Inky, DESATURATED_PALETTE
from inky.auto import auto
from matplotlib import pyplot
import seaborn
import argparse
Expand All @@ -14,16 +14,15 @@
You may need to: sudo apt install libatlas-base-dev
""")

inky = auto(ask_user=True, verbose=True)
# Convert the built-in palette to a list of colours usable by seaborn,
# This nets us 6 colours: Green, Blue, Red, Yellow, Orange, Black
palette_colors = [(c[0] / 255.0, c[1] / 255.0, c[2] / 255.0) for c in DESATURATED_PALETTE[2:6] + [(0, 0, 0)]]
palette_colors = [(c[0] / 255.0, c[1] / 255.0, c[2] / 255.0) for c in inky.DESATURATED_PALETTE[2:6] + [(0, 0, 0)]]

parser = argparse.ArgumentParser()
parser.add_argument("--dataset", "-d", choices=["penguins", "dots", "mpg"], default="mpg")
args = parser.parse_args()

inky = Inky()
saturation = 0
dpi = 80
buf = io.BytesIO()
Expand Down
Binary file added examples/7color/images/inky-4.0-beachanchors.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/7color/images/inky-4.0-redchain.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/7color/images/inky-4.0-roundship.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/7color/images/inky-4.0-ships.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/7color/images/inky-7.3-beachanchors.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/7color/images/inky-7.3-redchain.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/7color/images/inky-7.3-ships.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions examples/7color/stripes.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#!/usr/bin/env python3

from inky.auto import auto

# To simulate:
# from inky.mock import InkyMockImpression as Inky
from inky.auto import auto

inky = auto(ask_user=True, verbose=True)

for y in range(inky.height - 1):
color = y // (inky.height // 7)
for x in range(inky.width - 1):
inky.set_pixel(x, y, color)
inky.set_pixel(x, y, color *0x11)

inky.show()
# To simulate:
Expand Down
1 change: 1 addition & 0 deletions library/inky/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from .mock import InkyMockPHAT, InkyMockWHAT # noqa: F401
from .inky_uc8159 import Inky as Inky7Colour # noqa: F401
from .inky_ssd1683 import Inky as InkyWHAT_SSD1683 # noqa: F401
from .inky_ac073tc1a import Inky as Inky_Impressions_7 # noqa: F401
from .auto import auto # noqa: F401

__version__ = '1.4.0'
Expand Down
8 changes: 7 additions & 1 deletion library/inky/auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
from .what import InkyWHAT # noqa: F401
from .inky_uc8159 import Inky as InkyUC8159 # noqa: F401
from .inky_ssd1683 import Inky as InkyWHAT_SSD1683 # noqa: F401
from .inky_ac073tc1a import Inky as InkyAC073TC1A # noqa: F401
from . import eeprom
import argparse


DISPLAY_TYPES = ["what", "phat", "phatssd1608", "impressions", "7colour", "whatssd1683"]
DISPLAY_TYPES = ["what", "phat", "phatssd1608", "impressions", "7colour", "whatssd1683", "impressions73"]
DISPLAY_COLORS = ["red", "black", "yellow"]


Expand All @@ -31,6 +32,9 @@ def auto(i2c_bus=None, ask_user=False, verbose=False):
return InkyUC8159(resolution=(640, 400))
if _eeprom.display_variant in (17, 18, 19):
return InkyWHAT_SSD1683((400, 300), _eeprom.get_color())
if _eeprom.display_variant == 20:
return InkyAC073TC1A(resolution=(800, 480))


if ask_user:
if verbose:
Expand Down Expand Up @@ -73,6 +77,8 @@ def auto(i2c_bus=None, ask_user=False, verbose=False):
return InkyWHAT_SSD1683(colour=args.colour)
if args.type in ("impressions", "7colour"):
return InkyUC8159()
if args.type == "impressions73":
return InkyAC073TC1A()

if _eeprom is None:
raise RuntimeError("No EEPROM detected! You must manually initialise your Inky board.")
Expand Down
4 changes: 3 additions & 1 deletion library/inky/eeprom.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Inky display-type EEPROM tools."""
Expand Down Expand Up @@ -30,7 +31,8 @@
'7-Colour 640x400 (UC8159)',
'Black wHAT (SSD1683)',
'Red wHAT (SSD1683)',
'Yellow wHAT (SSD1683)'
'Yellow wHAT (SSD1683)',
'7-Colour 800x480 (AC073TC1A)'
]


Expand Down
1 change: 1 addition & 0 deletions library/inky/inky.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
_SPI_DATA = 1

_RESOLUTION = {
(800, 480): (800, 480,0),
(600, 448): (600, 448, 0),
(400, 300): (400, 300, 0),
(212, 104): (104, 212, -90),
Expand Down

0 comments on commit 00ca3b8

Please sign in to comment.