forked from 13Bytes/eInkCalendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplayTest.py
42 lines (32 loc) · 909 Bytes
/
displayTest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/python3
import lib.epd7in5b_V2 as eInk
from PIL import Image, ImageDraw, ImageFont
import sys
import os
import logging
import schedule
import time
def clearDisplay():
logging.info("Clear Display")
epd.init()
epd.Clear()
pictureDict = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'pictures')
try:
logging.info("epd7in5b_V2 Demo")
epd = eInk.EPD()
logging.info("init and Clear")
epd.init()
epd.Clear()
image = Image.open(os.path.join(pictureDict, 'ChristmasTree-b.bmp'))
image_red = Image.open(os.path.join(pictureDict, 'ChristmasTree-r.bmp'))
epd.display(epd.getbuffer(image), epd.getbuffer(image_red))
time.sleep(10)
clearDisplay()
logging.info("Goto Sleep...")
epd.sleep()
except IOError as e:
logging.info(e)
except KeyboardInterrupt:
logging.info("ctrl + c:")
eInk.epdconfig.module_exit()
exit()