Datasheet
color display. You can leave this alone.
if TRICOLOR:
highlight = 0xff0000 #third color is red (0xff0000)
else:
highlight = 0x000000
In the next line, we set the display bus to FourWire which makes use of the SPI bus. We pass it the D/C , and CS pins,
which are also usually found on TFT displays and if this is a breakout, we also pass in the reset pin.
We set the baudrate to 1 MHz instead of the default 24 MHz because the ePaper displays are not about the speed.
They are about the patience of waiting many seconds for them to change and the infrequent updates.
After that, we pause for 1 second. Remember, patience.
display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs,
reset=epd_reset, baudrate=1000000)
time.sleep(1)
Next is the initializer. You will want to uncomment the one appropriate to your display. For the 2.9" display, we would
want to comment out the line with 2.13" Tri-color OR Flexible Monochrome next to it and uncomment the line with 2.9"
Tri-color OR Flexible Monochrome next to it.
# Create the display object
#display = adafruit_ssd1608.SSD1608(display_bus, width=200, height=200, # 1.54" HD Monochrome
#display = adafruit_ssd1675.SSD1675(display_bus, width=122, height=250, # 2.13" HD Monochrome
#display = adafruit_il91874.IL91874(display_bus, width=264, height=176, # 2.7" Tri-color
#display = adafruit_il0398.IL0398(display_bus, width=400, height=300, # 4.2" Tri-color
#display = adafruit_il0373.IL0373(display_bus, width=152, height=152, # 1.54" Tri-color
#display = adafruit_il0373.IL0373(display_bus, width=296, height=128, swap_rams=FLEXIBLE, # 2.9" Tri-
color OR Flexible Monochrome
display = adafruit_il0373.IL0373(display_bus, width=212, height=104, swap_rams=FLEXIBLE, # 2.13" Tri-
color OR Flexible Monochrome
busy_pin=busy, rotation=ROTATION,
highlight_color=highlight)
Next we create a couple of variables including a displayio group and a file handle to the display-ruler.bmp that you
placed in your CIRCUITPY root folder. You did do that, right?
# Create a display group for our screen objects
g = displayio.Group()
# Display a ruler graphic from the root directory of the CIRCUITPY drive
f = open("/display-ruler.bmp", "rb")
Next we take the file handle and read the bitmap data into a TileGrid object. We also specify the pixel_shader to
displayio.ColorConverter() because we want displayio to convert the image data into something that will look nice
on the eInk. We take the TileGrid object and place it into the group.
© Adafruit Industries https://learn.adafruit.com/adafruit-eink-display-breakouts Page 35 of 61










