X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02-2.git/blobdiff_plain/a155e335d1f16716fe7c8a80491773a450c10fed..56fa663cd5be0e5e326a368365a16d0170570c74:/examples/lcd.py diff --git a/examples/lcd.py b/examples/lcd.py index aa0e193..10413b9 100755 --- a/examples/lcd.py +++ b/examples/lcd.py @@ -1,9 +1,16 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import ST7735 from PIL import Image, ImageDraw, ImageFont +from fonts.ttf import RobotoMedium as UserFont +import logging -print("""lcd.py - Hello, World! example on the 0.96" LCD. +logging.basicConfig( + format='%(asctime)s.%(msecs)03d %(levelname)-8s %(message)s', + level=logging.INFO, + datefmt='%Y-%m-%d %H:%M:%S') + +logging.info("""lcd.py - Hello, World! example on the 0.96" LCD. Press Ctrl+C to exit! @@ -32,7 +39,7 @@ draw = ImageDraw.Draw(img) # Text settings. font_size = 25 -font = ImageFont.truetype("fonts/Asap/Asap-Bold.ttf", font_size) +font = ImageFont.truetype(UserFont, font_size) text_colour = (255, 255, 255) back_colour = (0, 170, 170)