How drngominhtu/esp32_wirelessmouse works
This repository is an ESP32 firmware air mouse. Its workflow initializes the MPU6050 and calibrates it, then the main loop handles serial commands and—when BLE is connected—updates mouse input at a 50 Hz cadence. Motion processing applies calibration, deadzone and drift handling before sending cursor, scroll and click actions over BLE. Serial controls also expose configuration, status and I2C scanning. The single source file combines these responsibilities; finer internal boundaries reflect functions described in its excerpts. Other README capabilities are included where documented, though their implementation details were not sampled.
Main entry points: main.cpp Mouse update
Components 10
Firmware runtime
- Main loop
src/main.cpp
Motion processing
- Gyro calibration
src/main.cpp - Mouse update
src/main.cpp - Drift correction
src/main.cpp
Device interfaces
- MPU6050
- BLE mouse output
src/main.cpp - Serial commands
src/main.cpp - I2C scanner
src/main.cpp
Other components
- Device user
- BLE host
Connections 12
- Main loop → Gyro calibration: calibrates at setup
src/main.cpp - Main loop → Serial commands: handles commands
src/main.cpp - Main loop → Mouse update: updates when connected
src/main.cpp - Gyro calibration → MPU6050: samples readings
src/main.cpp - Mouse update → MPU6050: reads events
src/main.cpp - Mouse update → BLE mouse output: sends mouse actions
src/main.cpp - Serial commands → Gyro calibration: recalibrates
src/main.cpp - Serial commands → I2C scanner: starts scan
src/main.cpp - Device user → Serial commands: sends commands
README.md - Device user → MPU6050: moves device
README.md - BLE mouse output → BLE host: controls cursor
README.md - Mouse update → Drift correction: uses correction
src/main.cpp