From 80bdead749d08700385a81d5d62322c3027d2046 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 7 Mar 2026 19:12:32 +0000 Subject: [PATCH] server_microphone_oled.py aktualisiert --- server_microphone_oled.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server_microphone_oled.py b/server_microphone_oled.py index 51d862c..07b3a01 100644 --- a/server_microphone_oled.py +++ b/server_microphone_oled.py @@ -50,7 +50,7 @@ async def run_test(): run_stop_only_once_flag = True # I2C-Schnittstelle initialisieren (Port 1, Adresse 0x3C) - serial = i2c(port=1, address=0x3C) + serial = i2c(port=5, address=0x3C) # Display-Objekt erstellen (128x64 Blue&Yellow-Display) oled_device = ssd1306(serial, width=128, height=64) @@ -60,9 +60,11 @@ async def run_test(): finalResult = await websocket.recv() # oled ausgabe with canvas(oled_device) as draw: - oled_string = finalResult[-20:].replace('partial','').replace('[','').replace(']','').replace('\n','') + oled_string = finalResult[-45:].replace('partial','').replace('[','').replace(']','').replace('\n','') + oled_out = [oled_string[i:i+15] for i in range(0, len(oled_string), 15)] + oled_out = "\n".join(oled_out) draw.text((0,0), "Erwin hoert:", fill="white") - draw.text((0, 15), oled_string, fill="white") + draw.text((0, 15), oled_out, fill="white") #print(finalResult) if "licht" in finalResult and "an" in finalResult and activation_word in finalResult and run_stop_only_once_flag: print("SCHALTER EIN!")