Compare commits
6 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
788bad8c44 | ||
|
|
2a09649a82 | ||
|
|
8f155e7985 | ||
|
|
fb7839244a | ||
|
|
aa4d3a0360 | ||
|
|
a741cb1a6a |
5 changed files with 22 additions and 26 deletions
|
|
@ -12,7 +12,7 @@ sphinx:
|
|||
configuration: docs/conf.py
|
||||
|
||||
build:
|
||||
os: ubuntu-20.04
|
||||
os: ubuntu-lts-latest
|
||||
tools:
|
||||
python: "3"
|
||||
|
||||
|
|
|
|||
12
README.rst
12
README.rst
|
|
@ -89,15 +89,8 @@ Usage Example
|
|||
|
||||
g = displayio.Group()
|
||||
|
||||
f = open("/display-ruler.bmp", "rb")
|
||||
|
||||
pic = displayio.OnDiskBitmap(f)
|
||||
# CircuitPython 6 & 7 compatible
|
||||
t = displayio.TileGrid(
|
||||
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
|
||||
)
|
||||
# CircuitPython 7 compatible only
|
||||
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
|
||||
pic = displayio.OnDiskBitmap("/display-ruler.bmp")
|
||||
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
|
||||
g.append(t)
|
||||
|
||||
display.root_group = g
|
||||
|
|
@ -108,6 +101,7 @@ Usage Example
|
|||
|
||||
time.sleep(120)
|
||||
|
||||
|
||||
Documentation
|
||||
=============
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,14 @@ Implementation Notes
|
|||
|
||||
"""
|
||||
|
||||
import displayio
|
||||
import epaperdisplay
|
||||
|
||||
try:
|
||||
import typing
|
||||
|
||||
import fourwire
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
__version__ = "0.0.0+auto.0"
|
||||
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_SSD1608.git"
|
||||
|
|
@ -45,10 +52,10 @@ _START_SEQUENCE = (
|
|||
_STOP_SEQUENCE = b"\x10\x01\x01" # Enter deep sleep
|
||||
|
||||
|
||||
class SSD1608(displayio.EPaperDisplay):
|
||||
class SSD1608(epaperdisplay.EPaperDisplay):
|
||||
"""SSD1608 driver"""
|
||||
|
||||
def __init__(self, bus: displayio.FourWire, **kwargs) -> None:
|
||||
def __init__(self, bus: fourwire.FourWire, **kwargs) -> None:
|
||||
start_sequence = bytearray(_START_SEQUENCE)
|
||||
width = kwargs["width"]
|
||||
start_sequence[4] = (width - 1) & 0xFF
|
||||
|
|
|
|||
|
|
@ -36,20 +36,14 @@ display = adafruit_ssd1608.SSD1608(
|
|||
|
||||
g = displayio.Group()
|
||||
|
||||
with open("/display-ruler.bmp", "rb") as f:
|
||||
pic = displayio.OnDiskBitmap(f)
|
||||
# CircuitPython 6 & 7 compatible
|
||||
t = displayio.TileGrid(
|
||||
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
|
||||
)
|
||||
# CircuitPython 7 compatible only
|
||||
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
|
||||
g.append(t)
|
||||
pic = displayio.OnDiskBitmap("/display-ruler.bmp")
|
||||
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
|
||||
g.append(t)
|
||||
|
||||
display.root_group = g
|
||||
display.root_group = g
|
||||
|
||||
display.refresh()
|
||||
display.refresh()
|
||||
|
||||
print("refreshed")
|
||||
print("refreshed")
|
||||
|
||||
time.sleep(120)
|
||||
time.sleep(120)
|
||||
|
|
|
|||
|
|
@ -3,3 +3,4 @@
|
|||
# SPDX-License-Identifier: Unlicense
|
||||
|
||||
Adafruit-Blinka
|
||||
Adafruit-Blinka-Displayio
|
||||
|
|
|
|||
Loading…
Reference in a new issue