Skip to content

Instantly share code, notes, and snippets.

@ericmjl
Created April 28, 2019 11:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericmjl/6c897c51b62a4ff15cf8aa439fbc6f0a to your computer and use it in GitHub Desktop.
Save ericmjl/6c897c51b62a4ff15cf8aa439fbc6f0a to your computer and use it in GitHub Desktop.
Custom module that wraps waveshare's e-paper display code.
from PIL import Image
def read_img(fname):
b = Image.open("images/{fname}_b.bmp".format(fname=fname))
r = Image.open("images/{fname}_r.bmp".format(fname=fname))
return b, r
def display(fname, epd):
b, r = read_img(fname)
epd.Clear(0xFF)
epd.display(epd.getbuffer(b), epd.getbuffer(r))
epd.sleep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment