~xenrox/status-display

c59ba684fd05cd0742a38122b2f296db35bd0b75 — Thorben Günther 3 years ago d577c14
Add test.py
2 files changed, 23 insertions(+), 0 deletions(-)

M README.md
A test.py
M README.md => README.md +2 -0
@@ 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

A test.py => test.py +21 -0
@@ 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()