How asterismp/muggleswand-src works
Muggles’ Wand is ESP32-S3 firmware for a gesture-controlled LED wand. At startup, the firmware initializes services, hardware, inference, and the apps; IMU samples feed gesture buffering and TensorFlow Lite inference, whose events the app task maps to LED effects and features such as BLE HID, ESP-NOW, Lumos, and POV drawing. Separate branches provide console/system control, a web-managed access point, OTA, sleep, and battery/power status. The README documents these capabilities; several implementation files were not sampled, so those links are included only where documented or indexed references support them.
Main entry points: APP.cpp Gesture app dispatcher · Service.cpp System service · main.cpp Firmware startup · EventBus.cpp Event bus
Components 28
Startup and Coordination
- Firmware startup
src/main.cpp - Event bus
src/Service/EventBus.cpp
Sensing and Inference
- IMU acquisition
src/HAL/HAL_IMU.cpp - ICM42670P driver
src/HAL/HAL_ICM42670P.cpp - Gesture buffer
src/Model/gesture_buffer.cpp - Gesture inference
src/Model/gesture_inference.cpp - Gesture model
src/Model/gesture_model.h
User Features
- Gesture app dispatcher
src/APP/APP.cpp - BLE HID modes
src/APP/APP_BLE_HID.cpp - ESP-NOW signaling
src/APP/APP_EspNow.cpp - Lumos mode
src/APP/APP_Lumos.cpp - POV drawing
src/APP/APP_POV.cpp - POV patterns
src/APP/APP_POVPatterns.h
Hardware and Effects
- LED animation engine
src/HAL/HAL_WS2812.cpp - Animation base
src/HAL/WS2812_Animation/AnimationBase.hpp - Animation effects
src/HAL/WS2812_Animation/AnimPOV.hpp - Board HAL
src/HAL/HAL.h - Power and battery
src/HAL/HAL_Power.cpp
System Services
- System service
src/Service/Service.cpp - Serial console
src/Service/Console.cpp - Wi-Fi access point
src/Service/AP.cpp - Web management
src/Service/AP_Web.cpp - BLE service
src/Service/BLE.cpp - OTA update
src/Service/OTA.cpp - Sleep service
src/Service/Sleep.cpp
Other components
- Wand user
- Web administrator
- BLE host device
Connections 36
- Firmware startup → Event bus: initializes
src/main.cpp - Firmware startup → System service: starts
src/main.cpp - Firmware startup → Gesture inference: initializes and starts
src/main.cpp - Firmware startup → Board HAL: initializes
src/main.cpp - Firmware startup → Gesture app dispatcher: initializes
src/main.cpp - IMU acquisition → ICM42670P driver: reads sensor
src/HAL/HAL_IMU.cpp - IMU acquisition → Gesture buffer: fills samples
src/HAL/HAL_IMU.cpp - IMU acquisition → Event bus: publishes IMU events
src/HAL/HAL_IMU.cpp - Gesture inference → Gesture buffer: acquires samples
src/Model/gesture_inference.cpp - Gesture inference → Gesture model: runs model
src/Model/gesture_inference.cpp - Gesture inference → Event bus: publishes gesture
src/Model/gesture_inference.cpp - Event bus → Gesture app dispatcher: delivers events
src/APP/APP.cpp - Gesture app dispatcher → LED animation engine: starts effects
src/APP/APP.cpp - Gesture app dispatcher → ESP-NOW signaling: sends signals
src/APP/APP.cpp - Gesture app dispatcher → BLE HID modes: dispatches HID actions
src/APP/APP.cpp - Gesture app dispatcher → Lumos mode: triggers mode
src/APP/APP.cpp - Gesture app dispatcher → POV drawing: controls mode
src/APP/APP.cpp - POV drawing → POV patterns: selects pattern
src/APP/APP_POV.cpp - POV drawing → LED animation engine: renders drawing
src/APP/APP_POV.cpp - LED animation engine → Animation base: manages animations
src/HAL/HAL_WS2812.cpp - Animation effects → Animation base: implements
src/HAL/WS2812_Animation/AnimPOV.hpp - BLE HID modes → BLE service: uses BLE service
src/APP/APP_BLE_HID.cpp - Firmware startup → Serial console: initializes
src/main.cpp - Serial console → Event bus: issues system events
- System service → Event bus: subscribes to events
src/Service/Service.cpp - System service → OTA update: starts update mode
src/Service/Service.cpp - System service → BLE service: toggles BLE
src/Service/Service.cpp - System service → Wi-Fi access point: toggles hotspot
src/Service/Service.cpp - System service → Sleep service: enters sleep
src/Service/Service.cpp - System service → Board HAL: controls power and LEDs
src/Service/Service.cpp - Web management → Event bus: uses event bus
src/Service/AP_Web.cpp - Wi-Fi access point → Web management: serves management
- Web administrator → Web management: manages firmware
README.md - BLE service → BLE host device: communicates
README.md - Wand user → Gesture app dispatcher: gestures and presses
README.md - Board HAL → Power and battery: exposes power APIs
src/HAL/HAL.h