From c59ba684fd05cd0742a38122b2f296db35bd0b75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Sun, 5 Jul 2020 16:30:15 +0200 Subject: [PATCH] Add test.py --- README.md | 2 ++ test.py | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 test.py diff --git a/README.md b/README.md index 7c88b1c..7edf59a 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,5 @@ Code for updating my 7.5" Waveshare e-ink status display, which is connected to Based on [waveshare-code]. [waveshare-code]: https://github.com/waveshare/e-Paper + +apt-get install python3-pillow python3-rpi.gpio python3-spidev fonts-roboto diff --git a/test.py b/test.py new file mode 100644 index 0000000..e1df51e --- /dev/null +++ b/test.py @@ -0,0 +1,21 @@ +import os + +import driver as epd +from PIL import Image, ImageDraw, ImageFont + +epd = epd.EPD() + +print("init and clear") +epd.init() +epd.clear() + +font = ImageFont.truetype("Roboto-Regular.ttf", 200) + +print("draw") +Himage = Image.new("1", (epd.width, epd.height), 255) # 255: clear the frame +draw = ImageDraw.Draw(Himage) +draw.text((100, 100), "xenrox", font=font, fill=0) +epd.display(epd.getbuffer(Himage)) + +print("sleep") +epd.sleep() -- 2.44.0