diff options
| author | nasrlol <nsrddyn@gmail.com> | 2024-11-18 21:47:03 +0100 |
|---|---|---|
| committer | nasrlol <nsrddyn@gmail.com> | 2024-11-18 21:47:03 +0100 |
| commit | dbf4264109f52fb7d1479d1119e39fddafd952bd (patch) | |
| tree | 2475d089462b8438050690faa1f4a2a77038f9dc | |
| parent | 742e86dea54eaed4db8cad82835c7c946f40f8e4 (diff) | |
wrong use of the i2c code, used display_text instead of text(), confused how i did that
| -rw-r--r-- | bin/main.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/bin/main.py b/bin/main.py index 60978bb..482fde0 100644 --- a/bin/main.py +++ b/bin/main.py @@ -22,8 +22,8 @@ def display_cpu_info(): load = os.getloadavg()[0] temperature = cpu_temp.temperature lcd_instance.clear() - lcd_instance.display_text(f"CPU Load: {load}", 1) - lcd_instance.display_text(f"Temp: {temperature:.1f}C", 2) + lcd_instance.text(f"CPU Load: {load}", 1) + lcd_instance.text(f"Temp: {temperature:.1f}C", 2) time.sleep(5) @@ -33,7 +33,7 @@ def display_uptime(): uptime_seconds = float(f.readline().split()[0]) uptime_str = time.strftime("%H:%M:%S", time.gmtime(uptime_seconds)) lcd_instance.clear() - lcd_instance.display_text(f"Uptime: {uptime_str}", 1, "center") + lcd_instance.text(f"Uptime: {uptime_str}", 1, "center") def recognize_speech(): @@ -45,13 +45,13 @@ def recognize_speech(): audio = recognizer.listen(source) text = recognizer.recognize_google(audio) lcd_instance.clear() - lcd_instance.display_text(text, 1) + lcd_instance.text(text, 1) print("Speech recognized:", text) except speech.UnknownValueError: - lcd_instance.display_text(ERROR_BAD_REQUEST, 1) + lcd_instance.text(ERROR_BAD_REQUEST, 1) print(ERROR_BAD_REQUEST) except speech.RequestError: - lcd_instance.display_text(ERROR_UNAUTHORIZED, 1) + lcd_instance.text(ERROR_UNAUTHORIZED, 1) print(ERROR_UNAUTHORIZED) @@ -61,7 +61,7 @@ def save_notes(): output = input() if output.lower() in ["stop", "break", "quit", "exit"]: break - lcd_instance.display_text(output, 1) + lcd_instance.text(output, 1) time.sleep(2) @@ -85,7 +85,7 @@ def main(): if action: action() else: - lcd_instance.display_text(ERROR_NOT_FOUND, 1) + lcd_instance.text(ERROR_NOT_FOUND, 1) print(ERROR_NOT_FOUND) |
