futarin_led/
├app/
└futarin_led.py
└main.py
├README.md
├pyproject.toml
├uv.lock1.リポジトリをクローンする
git clone https://github.com/futaringoto/futarin-led.gitこれらのライブラリを使用します。また、仮想環境を必要とします。
rpi_ws281x->https://github.com/rpi-ws281x/rpi-ws281x-python.git
flask->https://github.com/pallets/flask
uv->https://docs.astral.sh/uv/#getting-started
curl -LsSf https://astral.sh/uv/install.sh | sh
uv add rpi_ws281x
uv add Flaskcd futarin_led
uvpath=$(which uv)
sudo ${uvpath} run app/main.py このコードは光り方の関数を記述しています。
光が回転します。
・wait_ms=x
xに任意の数字を入力し、一周する時間(ms)を定められます
点灯します
・wait_ms=x
xに任意の実数を入力し、一周する時間(ms)を定められます。
・iterations=x
turn_on関数に関しては1とします。
点滅します。
・wait_ms=x
xに任意の実数を入力し、一周する時間(ms)を定められます。
・iterations=x
xに任意の実数を入力し、点滅の回数を定められます。
flaskを利用しサーバーを立てています。
Wifi接続が強い時。
青点灯
wifi接続が中程度の時
黄点灯
wifi接続が弱い時 橙点灯
wifi未接続時 赤点灯
聞き取り中 青点滅
処理中 青回転
応答成功 青点灯
応答失敗 赤点灯