|
4 | 4 | from adafruit_epd.epd import Adafruit_EPD
|
5 | 5 | from adafruit_epd.il0373 import Adafruit_IL0373
|
6 | 6 | from adafruit_epd.il91874 import Adafruit_IL91874
|
| 7 | +from adafruit_epd.il0398 import Adafruit_IL0398 |
7 | 8 |
|
8 | 9 | # create the spi device and pins we will need
|
9 | 10 | spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
|
10 | 11 | ecs = digitalio.DigitalInOut(board.D10)
|
11 | 12 | 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 |
13 | 14 | rst = digitalio.DigitalInOut(board.D11) # can be None to not use this pin
|
14 | 15 | busy = digitalio.DigitalInOut(board.D12) # can be None to not use this pin
|
15 | 16 |
|
16 | 17 | # give them all to our driver
|
17 | 18 | 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 |
20 | 24 | cs_pin=ecs, dc_pin=dc, sramcs_pin=srcs,
|
21 | 25 | rst_pin=rst, busy_pin=busy)
|
22 | 26 |
|
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 |
24 | 32 |
|
25 | 33 | # clear the buffer
|
26 | 34 | print("Clear buffer")
|
27 | 35 | display.fill(Adafruit_EPD.WHITE)
|
| 36 | +display.pixel(10, 100, Adafruit_EPD.BLACK) |
28 | 37 |
|
29 | 38 | print("Draw Rectangles")
|
30 | 39 | display.fill_rect(5, 5, 10, 10, Adafruit_EPD.RED)
|
|
36 | 45 |
|
37 | 46 | print("Draw text")
|
38 | 47 | display.text('hello world', 25, 10, Adafruit_EPD.BLACK)
|
39 |
| - |
40 | 48 | display.display()
|
0 commit comments