How alexledevdu22/ambilight works
This is a desktop Ambilight system with a Python controller and Arduino LED firmware. The main workflow is user configuration in the Tkinter UI, followed by screen capture and edge-color mapping or audio analysis and color generation; the controller smooths colors and sends them over serial to the LED strip. The firmware also accepts infrared remote controls for standalone effects. The tree documents additional mouse-responsive and Spotify features, but their detailed wiring is not shown in the sampled source, so those links are kept limited.
Main entry points: main.py Controller loop · main.cpp Firmware loop · ui.py Settings UI · sound_ambient.py Sound effects
Components 20
Desktop controller
- Settings UI
client/ui.py - Controller loop
client/main.py - Configuration
client/config.py - Serial LED sender
client/led_strip.py
Capture and effects
- Screen capture
client/screen_capture.py - Edge mapper
client/led_mapper.py - Audio sources
client/audio_sources.py - Sound effects
client/sound_ambient.py - Mouse ambient
client/mouse.py
Arduino firmware
- Firmware loop
arduino-ambilight/src/main.cpp - Serial frame parser
arduino-ambilight/src/buffer.cpp - IR decoder
arduino-ambilight/src/remote.cpp - LED modes
arduino-ambilight/src/modes.cpp - LED driver
arduino-ambilight/src/leds.cpp
External integrations
- Screen
- Audio device
- Spotify
- IR remote
- LED strip
Other components
- User
Connections 21
- User → Settings UI: sets options
- Settings UI → Controller loop: start or stop
- Settings UI → Configuration: saves settings
- Controller loop → Configuration: loads settings
- Controller loop → Screen capture: captures frames
- Screen → Screen capture: provides image
- Controller loop → Edge mapper: maps frame
- Controller loop → Mouse ambient: updates frame
- Controller loop → Sound effects: gets colors
- Sound effects → Audio sources: reads samples
- Audio device → Audio sources: provides audio
- Spotify → Sound effects: track metadata
- Controller loop → Serial LED sender: sends colors
- Serial LED sender → Firmware loop: serial data
- Firmware loop → Serial frame parser: checks frames
- Serial frame parser → LED driver: writes RGB
- IR remote → IR decoder: sends commands
- Firmware loop → IR decoder: reads codes
- Firmware loop → LED modes: dispatches controls
- LED modes → LED driver: renders effects
- LED driver → LED strip: drives LEDs