Improvements

This commit is contained in:
Maximilian Giller 2023-10-11 01:51:32 +02:00
parent 518d441f4d
commit e4f88110fd
2 changed files with 11 additions and 0 deletions

View file

@ -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

View file

@ -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"}