diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 88bca9f..255dafd 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -12,7 +12,7 @@ sphinx: configuration: docs/conf.py build: - os: ubuntu-20.04 + os: ubuntu-lts-latest tools: python: "3" diff --git a/README.rst b/README.rst index fdde842..0d67c6d 100644 --- a/README.rst +++ b/README.rst @@ -103,16 +103,8 @@ Usage Example g = displayio.Group() - # CircuitPython 6 & 7 compatible - f = open("/display-ruler.bmp", "rb") - pic = displayio.OnDiskBitmap(f) - t = displayio.TileGrid( - pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter()) - ) - - # # CircuitPython 7 compatible only - # pic = displayio.OnDiskBitmap("/display-ruler.bmp") - # 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) diff --git a/examples/ssd1680_2.13_featherwing.py b/examples/ssd1680_2.13_featherwing.py index aeeb31e..9e9f5ef 100644 --- a/examples/ssd1680_2.13_featherwing.py +++ b/examples/ssd1680_2.13_featherwing.py @@ -42,25 +42,25 @@ g = displayio.Group() -with open("/display-ruler.bmp", "rb") as f: - pic = displayio.OnDiskBitmap(f) - t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader) +pic = displayio.OnDiskBitmap("/display-ruler.bmp") - g.append(t) +t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader) - display.root_group = g +g.append(t) - display.refresh() +display.root_group = g - print("refreshed") +display.refresh() - time.sleep(display.time_to_refresh + 5) - # Always refresh a little longer. It's not a problem to refresh - # a few seconds more, but it's terrible to refresh too early - # (the display will throw an exception when if the refresh - # is too soon) - print("waited correct time") +print("refreshed") + +time.sleep(display.time_to_refresh + 5) +# Always refresh a little longer. It's not a problem to refresh +# a few seconds more, but it's terrible to refresh too early +# (the display will throw an exception when if the refresh +# is too soon) +print("waited correct time") # Keep the display the same diff --git a/examples/ssd1680_2.13_mono_eink_bonnet.py b/examples/ssd1680_2.13_mono_eink_bonnet.py index a21f57c..ef58241 100644 --- a/examples/ssd1680_2.13_mono_eink_bonnet.py +++ b/examples/ssd1680_2.13_mono_eink_bonnet.py @@ -35,7 +35,7 @@ display_bus = FourWire(spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000) time.sleep(1) -# For issues with display not updating top/bottom rows correctly set colstart to 8 +# For issues with display not updating top/bottom rows correctly try setting colstart to 8 or 0 display = adafruit_ssd1680.SSD1680( display_bus, width=250, @@ -43,28 +43,29 @@ busy_pin=epd_busy, highlight_color=0xFF0000, rotation=90, + colstart=-8, ) g = displayio.Group() -with open("display-ruler.bmp", "rb") as f: - pic = displayio.OnDiskBitmap(f) - t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader) - g.append(t) - display.root_group = g +pic = displayio.OnDiskBitmap("/display-ruler.bmp") +t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader) +g.append(t) - display.refresh() +display.root_group = g - print("refreshed") +display.refresh() - time.sleep(display.time_to_refresh + 5) - # Always refresh a little longer. It's not a problem to refresh - # a few seconds more, but it's terrible to refresh too early - # (the display will throw an exception when if the refresh - # is too soon) - print("waited correct time") +print("refreshed") + +time.sleep(display.time_to_refresh + 5) +# Always refresh a little longer. It's not a problem to refresh +# a few seconds more, but it's terrible to refresh too early +# (the display will throw an exception when if the refresh +# is too soon) +print("waited correct time") # Keep the display the same diff --git a/examples/ssd1680_2.13_tricolor_breakout.py b/examples/ssd1680_2.13_tricolor_breakout.py index 7329dbc..cf1230f 100644 --- a/examples/ssd1680_2.13_tricolor_breakout.py +++ b/examples/ssd1680_2.13_tricolor_breakout.py @@ -41,17 +41,17 @@ g = displayio.Group() -with open("/display-ruler.bmp", "rb") as f: - pic = displayio.OnDiskBitmap(f) - t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader) +pic = displayio.OnDiskBitmap("/display-ruler.bmp") - g.append(t) +t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader) - display.root_group = g +g.append(t) - display.refresh() +display.root_group = g - print("refreshed") +display.refresh() - time.sleep(120) +print("refreshed") + +time.sleep(120) diff --git a/examples/ssd1680_2.9_tricolor_breakout.py b/examples/ssd1680_2.9_tricolor_breakout.py new file mode 100644 index 0000000..922878d --- /dev/null +++ b/examples/ssd1680_2.9_tricolor_breakout.py @@ -0,0 +1,57 @@ +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +# SPDX-FileCopyrightText: Copyright (c) 2023 Jose D. Montoya +# +# SPDX-License-Identifier: Unlicense + + +"""Simple test script for Adafruit 2.9" Tri-Color eInk Display Breakout +Supported products: + * Adafruit 2.9" Tri-Color eInk Display Breakout + * https://www.adafruit.com/product/1028 + +""" + +import time + +import board +import displayio +from fourwire import FourWire + +import adafruit_ssd1680 + +displayio.release_displays() + +# This pinout works on a Metro M4 and may need to be altered for other boards. +spi = board.SPI() # Uses SCK and MOSI +epd_cs = board.D9 +epd_dc = board.D10 +epd_reset = board.D5 +epd_busy = board.D6 + +display_bus = FourWire(spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000) +time.sleep(1) + +display = adafruit_ssd1680.SSD1680( + display_bus, + width=296, + height=128, + highlight_color=0xFF0000, + rotation=270, +) + +g = displayio.Group() + + +pic = displayio.OnDiskBitmap("/display-ruler.bmp") + +t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader) + +g.append(t) + +display.root_group = g + +display.refresh() + +print("refreshed") + +time.sleep(120) diff --git a/examples/ssd1680_simpletest.py b/examples/ssd1680_simpletest.py index 0613236..8b3bcb9 100644 --- a/examples/ssd1680_simpletest.py +++ b/examples/ssd1680_simpletest.py @@ -51,23 +51,23 @@ g = displayio.Group() # Note: Check the name of the file. Sometimes the dash is changed to an underscore -with open("/display-ruler.bmp", "rb") as f: - pic = displayio.OnDiskBitmap(f) - t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader) - g.append(t) - display.root_group = g +pic = displayio.OnDiskBitmap("/display-ruler.bmp") +t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader) +g.append(t) - display.refresh() +display.root_group = g - print("refreshed") +display.refresh() - time.sleep(display.time_to_refresh + 5) - # Always refresh a little longer. It's not a problem to refresh - # a few seconds more, but it's terrible to refresh too early - # (the display will throw an exception when if the refresh - # is too soon) - print("waited correct time") +print("refreshed") + +time.sleep(display.time_to_refresh + 5) +# Always refresh a little longer. It's not a problem to refresh +# a few seconds more, but it's terrible to refresh too early +# (the display will throw an exception when if the refresh +# is too soon) +print("waited correct time") # Keep the display the same pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy