From e4f88110fd3a02453ff0625f1dec0196a2ec05de Mon Sep 17 00:00:00 2001 From: Maximilian Giller Date: Wed, 11 Oct 2023 01:51:32 +0200 Subject: [PATCH] Improvements --- README.md | 5 +++++ src/main.py | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index be503ec..30c1882 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # Matrix Clock +To run server: +`uvicorn main:app --reload --host 0.0.0.0` + + + >> sudo usermod -a -G spi,gpio pi >> sudo apt install build-essential python3-dev python3-pip libfreetype6-dev libjpeg-dev libopenjp2-7 libtiff5 diff --git a/src/main.py b/src/main.py index 6cc5c78..8dcfe18 100644 --- a/src/main.py +++ b/src/main.py @@ -48,8 +48,14 @@ async def turn_off(): @app.post("/flash") async def flash(count: int = 1): global should_run_time_loop + was_clock_runnign = should_run_time_loop should_run_time_loop = False + matrix_display.flash(count) + + if was_clock_runnign: + should_run_time_loop = True + asyncio.create_task(display_time()) return {"message": "Display flashed"}