How rohanjudd/ble-fx-control works
Project Type and Purpose
• This is an embedded firmware project (“BLE FX Control”) targeting an Arduino-compatible microcontroller (BLE-enabled) to sense inputs (sensors, analog controls) and drive outputs (LEDs, OLED display, haptic/tactile feedback) under commands received over Bluetooth Low Energy (BLE).
Main Architectural Components
a. Hardware Abstraction Layer (HAL) – device drivers for each peripheral:
• AmpControl (audio or signal amplitude control via DAC/PWM)
• Analogue (knobs/potentiometers or analog sensors)
• Hall (magnetic sensor)
• IMU (inertial measurement unit)
• Tactile (buttons, switches, haptic actuator)
• LED (RGB or status LEDs)
• OLED (display driver)
b. Communication Layer
• BLE (nRF52832 or similar)—receives control commands, streams sensor data
c. Application Logic / Control “Nav”
• Nav.cpp/h implements the finite-state machine or signal-routing logic, sequences effects, handles mode switching
d. Presentation Layer
• OLED display UI
• LED patterns
• Tactile/haptic feedback patterns
e. Build / Configuration
• .ino sketch (BLE_FX_Control5.ino) ties all components together in Arduino setup()/loop()
Interactions & Data Flows
• BLE ←→ Nav: receive commands (effect parameters, mode select), send sensor telemetry
• Sensors (IMU, Hall, Analogue) → HAL → Nav: continuous data feed for gesture or position-based modulation
• Nav → Outputs:
• AmpControl → external amplifier or audio chain
• LED module → visual effects
• Tactile → haptic feedback
• OLED → display current mode/status
Architectural Patterns & Principles
• Layered architecture separating hardware drivers (each .cpp/.h pair) from application logic (Nav) and communication (BLE)
• Event-driven loop: Arduino sketch polls sensors and BLE events, dispatches to Nav FSM
• Single responsibility per driver module—clear boundaries for maintainability
a. Components to show:
• Microcontroller (as central node)
• Peripheral blocks: IMU, Hall, Analogue, Tactile, AmpControl, LED, OLED
• BLE radio module (internal to MCU or external)
• Application block “Nav / Control Logic”
c. Technologies & libraries:
• Arduino framework (setup/loop)
• BLE library (e.g., ArduinoBLE or Nordic SDK)
• I2C/SPI bus for IMU/OLED
• ADC for Analogue & Hall sensors
d. Patterns:
• Hardware Abstraction Layer (label per driver)
• Control / FSM layer
• Presentation / Output layer