Skip to content

Commit f8081ff

Browse files
committed
add more displays
1 parent eb8fe05 commit f8081ff

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

examples/epd_simpletest.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,36 @@
44
from adafruit_epd.epd import Adafruit_EPD
55
from adafruit_epd.il0373 import Adafruit_IL0373
66
from adafruit_epd.il91874 import Adafruit_IL91874
7+
from adafruit_epd.il0398 import Adafruit_IL0398
78

89
# create the spi device and pins we will need
910
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
1011
ecs = digitalio.DigitalInOut(board.D10)
1112
dc = digitalio.DigitalInOut(board.D9)
12-
srcs = digitalio.DigitalInOut(board.D7) # can be None to use internal memory
13+
srcs = None #digitalio.DigitalInOut(board.D7) # can be None to use internal memory
1314
rst = digitalio.DigitalInOut(board.D11) # can be None to not use this pin
1415
busy = digitalio.DigitalInOut(board.D12) # can be None to not use this pin
1516

1617
# give them all to our driver
1718
print("Creating display")
18-
display = Adafruit_IL91874(176, 264, spi, # 2.7" Tri-color display
19-
#display = Adafruit_IL0373(104, 212, spi, # 2.13" Tri-color display
19+
#display = Adafruit_IL91874(176, 264, spi, # 2.7" Tri-color display
20+
display = Adafruit_IL0373(104, 212, spi, # 2.13" Tri-color display
21+
#display = Adafruit_IL0373(152, 152, spi, # 1.54" Tri-color display
22+
#display = Adafruit_IL0373(128, 296, spi, # 2.9" Tri-color display
23+
#display = Adafruit_IL0398(400, 300, spi, # 4.2" Tri-color display
2024
cs_pin=ecs, dc_pin=dc, sramcs_pin=srcs,
2125
rst_pin=rst, busy_pin=busy)
2226

23-
display.rotation = 2
27+
# IF YOU HAVE A FLEXIBLE DISPLAY (2.13" or 2.9") uncomment these lines!
28+
#display.set_black_buffer(1, False)
29+
#display.set_color_buffer(1, False)
30+
31+
display.rotation = 1
2432

2533
# clear the buffer
2634
print("Clear buffer")
2735
display.fill(Adafruit_EPD.WHITE)
36+
display.pixel(10, 100, Adafruit_EPD.BLACK)
2837

2938
print("Draw Rectangles")
3039
display.fill_rect(5, 5, 10, 10, Adafruit_EPD.RED)
@@ -36,5 +45,4 @@
3645

3746
print("Draw text")
3847
display.text('hello world', 25, 10, Adafruit_EPD.BLACK)
39-
4048
display.display()

0 commit comments

Comments
 (0)