diff options
| author | Abdellah El Morabit <nsrddyn@gmail.com> | 2024-11-05 11:36:22 +0100 |
|---|---|---|
| committer | Abdellah El Morabit <nsrddyn@gmail.com> | 2024-11-05 11:36:22 +0100 |
| commit | d7b8b6ae21c07fe52e691e9090c24de0d09a401f (patch) | |
| tree | 88a2fe1056db3ce2cb5af35974e906b184be55f7 | |
| parent | 5466f96bd75f602f5b5fd44a7ccee745f2abfca0 (diff) | |
making a script file for make the lcd rpi dipslay more interactive
| -rw-r--r-- | .script.py.swp | bin | 0 -> 12288 bytes | |||
| -rw-r--r-- | script.py | 27 |
2 files changed, 27 insertions, 0 deletions
diff --git a/.script.py.swp b/.script.py.swp new file mode 100644 index 0000000..bf563bb --- /dev/null +++ b/.script.py.swp | |||
| Binary files differ | |||
diff --git a/script.py b/script.py new file mode 100644 index 0000000..6f79a59 --- /dev/null +++ b/script.py | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | import random | ||
| 2 | import time | ||
| 3 | from rpi_LCD import LCD | ||
| 4 | import speech_recognition as sr | ||
| 5 | import sounddevice | ||
| 6 | import os | ||
| 7 | |||
| 8 | LCD = LCD() | ||
| 9 | VOICE_REC = sr.Recognizer() | ||
| 10 | MIC = sr.Microphone() | ||
| 11 | PROCES_LOAD = os.getloadavg() | ||
| 12 | TIME = current_time.time() | ||
| 13 | |||
| 14 | # ERROR CODES | ||
| 15 | ERROR_BAD_REQUEST = '400' | ||
| 16 | ERROR_UNAUTHORIZED = '401' | ||
| 17 | ERROR_NOT_FOUND = '404' | ||
| 18 | ERROR_TIMEOUT = '408' | ||
| 19 | |||
| 20 | def CPU_INFO(): | ||
| 21 | while (True): | ||
| 22 | LCD.tex(PROCES_LOAD(),1) | ||
| 23 | |||
| 24 | def CLOCK(): | ||
| 25 | LCD.text(TIME,1) | ||
| 26 | |||
| 27 | |||
