Created
April 28, 2019 11:51
-
-
Save ericmjl/6c897c51b62a4ff15cf8aa439fbc6f0a to your computer and use it in GitHub Desktop.
Custom module that wraps waveshare's e-paper display code.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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