mirror of
https://github.com/RGBCube/GDUS
synced 2025-07-27 21:17:45 +00:00
Fix bugs
This commit is contained in:
parent
3c3d660bf6
commit
aec4e27bb6
2 changed files with 4 additions and 3 deletions
|
@ -10,10 +10,10 @@ leds = [
|
||||||
(19, True),
|
(19, True),
|
||||||
]
|
]
|
||||||
|
|
||||||
for led in leds:
|
for led in leds[1::]:
|
||||||
gpio.setmode(gpio.BCM)
|
gpio.setmode(gpio.BCM)
|
||||||
gpio.setup(led[0], gpio.OUT)
|
gpio.setup(led[0], gpio.OUT)
|
||||||
gpio.output(LED_PIN, int(led[1]))
|
gpio.output(led[0], int(led[1]))
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ async def toggle(number: int) -> str:
|
||||||
|
|
||||||
@app.get("/speak")
|
@app.get("/speak")
|
||||||
async def speak(text: str) -> str:
|
async def speak(text: str) -> str:
|
||||||
ret = os.system(f'gtts-cli "{text}" --output text.mp3; pw-play text.mp3')
|
ret = os.system(f'gtts-cli "{text}" --lang tr --output text.mp3; pw-play text.mp3')
|
||||||
|
|
||||||
return f"TEXT {'OK' if ret == 0 else 'FAIL'}, TEXT: {text}";
|
return f"TEXT {'OK' if ret == 0 else 'FAIL'}, TEXT: {text}";
|
||||||
|
|
||||||
|
|
|
@ -8,5 +8,6 @@ authors = [ "RGBCube" ]
|
||||||
python = "^3.8"
|
python = "^3.8"
|
||||||
|
|
||||||
fastapi = "0.105.0"
|
fastapi = "0.105.0"
|
||||||
|
gtts = "2.5.0"
|
||||||
"RPi.GPIO" = "0.7.1"
|
"RPi.GPIO" = "0.7.1"
|
||||||
uvicorn = "0.24.0.post1"
|
uvicorn = "0.24.0.post1"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue