Improvements
This commit is contained in:
parent
518d441f4d
commit
e4f88110fd
2 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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"}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue