From 5e3dc453020fe4324eda0360a7e583ef78c4eb4f Mon Sep 17 00:00:00 2001 From: gaoyang3513 Date: Sun, 2 Jul 2023 21:52:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=20=E6=9B=B4=E6=96=B0Re?= =?UTF-8?q?adme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ea308f8..e84ffe9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ -# Raspi-Home +# Raspi-SmartHome +A Raspberry Pi-based smart home project built on Python. From 1d4229f7c11e7778625545a83646c4a08b7db184 Mon Sep 17 00:00:00 2001 From: gaoyang3513 Date: Sun, 2 Jul 2023 22:08:09 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=20=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/main.py b/main.py index 5e0e45c..d1ab46e 100644 --- a/main.py +++ b/main.py @@ -53,3 +53,4 @@ def main(): if __name__=='__main__': main() + From 21d036376554de143e1eff7817bf290c404c75af Mon Sep 17 00:00:00 2001 From: gaoyang3513 Date: Sun, 2 Jul 2023 22:48:51 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=20=E4=BF=AE=E6=94=B9LE?= =?UTF-8?q?D=E6=A0=87=E9=A2=98=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [详细说明] 1. 使用系统字体ttf文件:DejaVuSans.ttf; 2. 调整字体大小:12 --- Pioneer600/Oled/oled.py | 4 +++- main.py | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Pioneer600/Oled/oled.py b/Pioneer600/Oled/oled.py index 2f671d8..c22e9db 100644 --- a/Pioneer600/Oled/oled.py +++ b/Pioneer600/Oled/oled.py @@ -58,7 +58,9 @@ class OLED(object): image = self.image # 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. draw.text((x, y), text, font=font, fill=255) diff --git a/main.py b/main.py index d1ab46e..83597d4 100644 --- a/main.py +++ b/main.py @@ -42,7 +42,7 @@ def main(): led_blink = threading.Thread(target=blink_loop, name='led_blink', args=(LED_GPIO_RED,)) led_blink.start() - oled.draw_text(0, 0, 16, 'Hello, workld') + oled.draw_text(0, 0, 14, 'Raspi-SmartHome') while True: time.sleep(1) @@ -53,4 +53,3 @@ def main(): if __name__=='__main__': main() -