From d71621da40956dc1176974273a76dafdf2b051fa Mon Sep 17 00:00:00 2001 From: Sean Corrigan Date: Fri, 13 Nov 2020 19:02:30 -0500 Subject: [PATCH] fix issue --- display.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/display.py b/display.py index f69ba57..7ea19f9 100644 --- a/display.py +++ b/display.py @@ -8,20 +8,24 @@ import traceback def sendUpdate(message): - epd = epd2in13.EPD() - epd.init(epd.FULL_UPDATE) - epd.Clear(0xFF) - - # Drawing on the image - image = Image.new('1', (epd2in13.EPD_HEIGHT, epd2in13.EPD_WIDTH), 255) # 255: clear the frame - # message = "testing 123 what is going\n on ahbfuasdfhkgasyudgfuasykgdf" - - font15 = ImageFont.truetype('wqy-microhei.ttc', 20) - draw.text((3, 3), '{}'.format(message), font = font15, fill = 0) - epd.display(epd.getbuffer(image)) - time.sleep(20) + draw = ImageDraw.Draw(image) + epd = epd2in13.EPD() + epd.init(epd.FULL_UPDATE) + epd.Clear(0xFF) + + # Drawing on the image + image = Image.new('1', (epd2in13.EPD_HEIGHT, epd2in13.EPD_WIDTH), 255) # 255: clear the frame + + # message = "testing 123 what is going\n on ahbfuasdfhkgasyudgfuasykgdf" + draw = ImageDraw.Draw(image) + + + font15 = ImageFont.truetype('wqy-microhei.ttc', 20) + draw.text((3, 3), '{}'.format(message), font = font15, fill = 0) + epd.display(epd.getbuffer(image)) + time.sleep(20) if __name__ == "__main__": sendUpdate('Please run this program via\na callable function\nin your own program')