Skip to content

Instantly share code, notes, and snippets.

@margyle
Created July 26, 2019 12:42
Show Gist options
  • Save margyle/27baa858922c6cc33dd9bd6b53cc2bb6 to your computer and use it in GitHub Desktop.
Save margyle/27baa858922c6cc33dd9bd6b53cc2bb6 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
# -*- coding:utf-8 -*-
import epd2in7b
import time
from PIL import Image,ImageDraw,ImageFont
import traceback
try:
epd = epd2in7b.EPD()
epd.init()
print("Clear...")
epd.Clear(0xFF)
print("read bmp file")
HBlackimage = Image.open('flowerR.bmp')
HRedimage = Image.open('flowerB.bmp')
epd.display(epd.getbuffer(HRedimage),epd.getbuffer(HBlackimage))
time.sleep(30)
epd.sleep()
except :
print ('traceback.format_exc():\n%s',traceback.format_exc())
exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment