How tylerjohnsonunl/arcade_controller_rgb works
This is firmware for a motion-activated RGBW lighting controller. The main loop scans a button, updates controller state, checks the sensor, and selects a lighting mode; the mode selects LED colors/effects and hardware outputs. The sampled sources establish these calls and the button/display/LED behaviors, but sensor, SPI, clock, and display implementations were not sampled, so their internal wiring is left unspecified.
Main entry points: main.c Main loop · controller.c Mode controller · led.c Color effects · button.c Button scanning
Components 15
Application flow
- Main loop
main.c - Mode controller
controller.c - Mode selection
mode.c
Inputs and timing
- Button scanning
button.c - Sensor checks
sensor.c - Clock service
clock.c - SPI interface
spi.c
Lighting and display
- Color effects
led.c - Seven-segment display
sevenSegment.c
Device support
- System initialization
mcc_generated_files/mcc.c - Pin configuration
mcc_generated_files/pin_manager.c - PWM drivers
mcc_generated_files/pwm1.c
Other components
- Button user
- Motion source
- Light outputs
Connections 25
- Button user → Button scanning: presses
- Motion source → Sensor checks: sensed by
- Main loop → System initialization: initializes
- System initialization → Pin configuration: configures
- Main loop → Clock service: initializes
- Main loop → Color effects: initializes
- Main loop → Sensor checks: initializes
- Main loop → SPI interface: initializes
- Main loop → Button scanning: initializes
- Main loop → Seven-segment display: initializes
- Main loop → Mode controller: initializes
- Main loop → Button scanning: scans
- Main loop → Mode controller: runs
- Main loop → Sensor checks: checks
- Main loop → Sensor checks: reads movement
- Main loop → Mode controller: reads mode
- Main loop → Mode selection: dispatches mode
- Mode controller → Button scanning: checks events
- Mode controller → Clock service: reads time
- Mode controller → Seven-segment display: updates digits
- Mode controller → Color effects: sets brightness
- Mode selection → Color effects: selects effect
- Mode selection → Light outputs: sets GPIO
- Color effects → Light outputs: sets color
- Color effects → PWM drivers: writes PWM registers