How maujabur/harpa_vl53l1x works
This is embedded firmware for a laser harp: it initializes a configured array of VL53L1X sensors, refreshes cached measurements without waiting for each sample, applies per-sensor press/release thresholds, and reports transitions and optional telemetry. The sampled source configures ten sensors and emits USB keyboard events; this conflicts with the README’s claims of twelve sensors and no keyboard output. The graph follows the sampled implementation where evidence is available and retains documented calibration and diagnostic capabilities. Relationships are limited to shown calls and data use; unsampled details are omitted.
Main entry points: main.cpp Firmware loop · harpa_controller.cpp Harp controller · lidar_array.cpp Sensor array · lidar_sensor.cpp Sensor driver
Components 12
Sensor acquisition
- Sensor array
src/lidar_array.cpp - Sensor driver
src/lidar_sensor.cpp - Sensor configuration
include/lidar_config.h - Reading cache
include/lidar_reading.h - Fixed-size array
include/harpa_array.h
Harp interaction
- Harp controller
src/harpa_controller.cpp - Harp state frame
include/harpa_controller.h
Firmware outputs
- Firmware loop
src/main.cpp - Sensor keymap
include/harpa_keymap.h
Other components
- ToF sensors
- USB keyboard output
- Serial diagnostics
Connections 12
- Firmware loop → Sensor array: services
src/main.cpp - Sensor array → Sensor driver: initializes and services
src/lidar_array.cpp - Sensor driver → ToF sensors: reads distances
src/lidar_sensor.cpp - Sensor driver → Sensor configuration: uses settings
src/lidar_sensor.cpp - Sensor array → Reading cache: copies readings
src/lidar_array.cpp - Firmware loop → Harp controller: updates from readings
src/main.cpp - Harp controller → Reading cache: checks validity and distance
src/harpa_controller.cpp - Harp controller → Sensor configuration: applies thresholds
src/harpa_controller.cpp - Harp controller → Harp state frame: produces transitions
src/harpa_controller.cpp - Firmware loop → Sensor keymap: looks up keys
src/main.cpp - Firmware loop → USB keyboard output: emits key events
src/main.cpp - Firmware loop → Serial diagnostics: prints status and telemetry
src/main.cpp