This is an old revision of the document!
The project I have chosen is a device that captures the dominant colors displayed on a PC screen and reproduces them on an LED strip mounted behind it.
Its purpose is to provide a pleasant experience for users who spend a lot of time in front of the computer, especially gamers.
The idea comes from TVs that have this LED system on the back to provide a unique experience while watching movies.
The utility of the project consists in enhancing the user's visual experience, creating a more captivating atmosphere, and reducing eye strain in low-light conditions.
| Component | Description |
|---|---|
| Arduino UNO | Microcontroller |
| LED Strip WS2812B | LEDs for color display |
| Button | Switches between operation modes |
| Wires | Connect components on the breadboard |
| Breadboard | Circuit assembly |
| Power Source | Powers the circuit |
| USB Cable | PC Connection |
Used Arduino UNO and an external library (FastLED) for controlling WS2812B LED strip.
The project features multiple operating modes that can be switched by pressing a button. The mode switching is handled via an external interrupt, allowing fast and responsive detection of the button press event.
ISR(INT0_vect) {
if ((long)(micros() - lastDebounceTime) >= debounceDelay) {
mode = (mode + 1) % 4;
lastDebounceTime = micros();
updateNeeded = true;
}
}
ISR(TIMER1_COMPA_vect) {
if (mode == 2) { // just in mode 2
millis_counter++;
if (millis_counter >= 30) { // every 30 ms
millis_counter = 0;
fadeBrightness += fadeDirection * 5; // change intensity
if (fadeBrightness >= 255) {
fadeBrightness = 255;
fadeDirection = -1; // starts to decrease
} else if (fadeBrightness <= 0) {
fadeBrightness = 0;
fadeDirection = 1; // starts to increase
fadeColorIndex = (fadeColorIndex + 1) % 3; // change color after a complete cycle
}
updateNeeded = true;
}
}
}
Fişierele se încarcă pe wiki folosind facilitatea Add Images or other files. Namespace-ul în care se încarcă fişierele este de tipul :pm:prj20??:c? sau :pm:prj20??:c?:nume_student (dacă este cazul). Exemplu: Dumitru Alin, 331CC → :pm:prj2009:cc:dumitru_alin.