Skip to content

Commit 45f6498

Browse files
authored
Merge pull request #2 from adafruit/TheKitty-patch-1
Update to pass and comment
2 parents 2ca7c25 + bb36e64 commit 45f6498

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

examples/il91874_simpletest.py

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,54 @@
1-
"""Simple test script for 2.7" 264x176 Tri-Color display shield
2-
3-
Supported products:
1+
"""
2+
Simple test script for 2.7" 264x176 Tri-Color display shield
3+
Supported products:
44
* Adafruit 2.7" Tri-Color ePaper Display Shield
5-
* https://www.adafruit.com/product/4229
6-
"""
5+
https://www.adafruit.com/product/4229
6+
7+
This program only requires the adafruit_il91874 library in /lib
8+
for CircuitPython 5.0 and above which has displayio support.
9+
"""
710

811
import time
912
import board
1013
import displayio
1114
import adafruit_il91874
1215

16+
# Used to ensure the display is free in CircuitPython
1317
displayio.release_displays()
1418

19+
# Define the pins needed for display use on the Metro
1520
spi = board.SPI()
1621
epd_cs = board.D10
1722
epd_dc = board.D9
1823

19-
display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000)
20-
time.sleep(1)
24+
# Create the displayio connection to the display pins
25+
display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs,
26+
baudrate=1000000)
27+
time.sleep(1) # Wait a bit
2128

22-
display = adafruit_il91874.IL91874(display_bus, width=264, height=176, highlight_color=0xff0000,
23-
rotation=90)
29+
# Create the display object - the third color is red (0xff0000)
30+
display = adafruit_il91874.IL91874(display_bus, width=264, height=176,
31+
highlight_color=0xff0000, rotation=90)
2432

33+
# Create a display group for our screen objects
2534
g = displayio.Group()
2635

36+
# Display a ruler graphic from the root directory of the CIRCUITPY drive
2737
f = open("/display-ruler.bmp", "rb")
2838

2939
pic = displayio.OnDiskBitmap(f)
40+
# Create a Tilegrid with the bitmap and put in the displayio group
3041
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
3142
g.append(t)
3243

44+
# Place the display group on the screen (does not refresh)
3345
display.show(g)
3446

47+
# Show the image on the display
3548
display.refresh()
3649

3750
print("refreshed")
3851

39-
time.sleep(120)
52+
# Do Not refresh the screen more often than every 180 seconds
53+
# for eInk displays! Rapid refreshes will damage the panel.
54+
time.sleep(180)

0 commit comments

Comments
 (0)