1
Fork 0
mirror of https://github.com/RGBCube/GDUS synced 2025-07-28 21:47:45 +00:00

Add local code

This commit is contained in:
RGBCube 2023-12-20 12:31:07 +03:00
parent d525fd353f
commit fcbfd988d5
No known key found for this signature in database

19
rpid/rpid/main.py Normal file
View file

@ -0,0 +1,19 @@
from fastapi import FastAPI
from RPi import GPIO as gpio
LED_PIN = 17
gipo.setmode(gpio.BCM)
state = False
def set(state: bool) -> None:
gpio.output(LED, int(!state))
set(state)
app = FastAPI()
@app.get("/toggle")
async def toggle() -> None:
set(!state)