Merge pull request 'Branch_GY3513' (#1) from Branch_GY3513 into main
Reviewed-on: https://gaoyang3513.synology.me:3000/gaoyang3513/Raspi-SmartHome/pulls/1
This commit is contained in:
@ -58,7 +58,9 @@ class OLED(object):
|
|||||||
image = self.image
|
image = self.image
|
||||||
|
|
||||||
# Load default font.
|
# Load default font.
|
||||||
font = ImageFont.load_default()
|
# font = ImageFont.load_default()
|
||||||
|
font_path = "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
|
||||||
|
font = ImageFont.truetype(font_path, size)
|
||||||
|
|
||||||
# Write two lines of text.
|
# Write two lines of text.
|
||||||
draw.text((x, y), text, font=font, fill=255)
|
draw.text((x, y), text, font=font, fill=255)
|
||||||
|
|||||||
@ -1,2 +1,3 @@
|
|||||||
# Raspi-Home
|
# Raspi-SmartHome
|
||||||
|
|
||||||
|
A Raspberry Pi-based smart home project built on Python.
|
||||||
|
|||||||
2
main.py
2
main.py
@ -42,7 +42,7 @@ def main():
|
|||||||
led_blink = threading.Thread(target=blink_loop, name='led_blink', args=(LED_GPIO_RED,))
|
led_blink = threading.Thread(target=blink_loop, name='led_blink', args=(LED_GPIO_RED,))
|
||||||
led_blink.start()
|
led_blink.start()
|
||||||
|
|
||||||
oled.draw_text(0, 0, 16, 'Hello, workld')
|
oled.draw_text(0, 0, 14, 'Raspi-SmartHome')
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user