Waveshare E-paper Display for Pico
Here is the same thing but for the Waveshare e-paper display for pico. This version (B) also displays red.
import time
import board
import busio
import digitalio
import requests
import adafruit_apds9960.apds9960
import adafruit_matrixportal.network
import adafruit_matrixportal.matrix
import adafruit_matrixportal_imageload
import adafruit_matrixportal_imagedisplay
import adafruit_pixel_shader
import adafruit_fancyled.adafruit_fancyled as fancy
# Set up the I2C bus for the APDS9960 gesture sensor
i2c = busio.I2C(board.SCL, board.SDA)
# Initialize the gesture sensor
gesture_sensor = adafruit_apds9960.apds9960.APDS9960(i2c)
# Initialize the MatrixPortal network and matrix
matrixportal_network = adafruit_matrixportal.network.MatrixPortalNetwork()
matrixportal_matrix = adafruit_matrixportal.matrix.Matrix()
# Initialize the E-Ink display
display = adafruit_matrixportal_imagedisplay.EPD_Display(
busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO),
cs=digitalio.DigitalInOut(board.CE0),
dc=digitalio.DigitalInOut(board.D27),
busy=digitalio.DigitalInOut(board.D17),
)
# Set up the pixel shader for dithering
shader = adafruit_pixel_shader.PixelShader(
width=display.width, height=display.height, brightness=1.0
)
# Set up the color palette for dithering
palette = [
fancy.CRGB(255, 255, 255), # white
fancy.CRGB(255, 0, 0), # red
fancy.CRGB(0, 0, 0), # black
]
# Set up the image display object
image_display = adafruit_matrixportal_imagedisplay.ImageDisplay(
display,
Comments are closed.