

#include <FastLED.h>
#define NUM_LEDS 256 // Panneau de 256 Leds
#define LED_TYPE WS2812
#define COLOR_ORDER GRB
#define STRIP_PIN 4
#define SPEEDELAY 1
#define RED 255
#define GREEN 255
#define BLUE 255
#define BRIGHTNESS 1 // Coefficient multipicateur des valeur RGB
CRGB leds[NUM_LEDS];
void setup() {
Serial.begin(9600);
FastLED.addLeds<LED_TYPE, STRIP_PIN, COLOR_ORDER>(leds, NUM_LEDS);
Serial.println("Programme en cours...");
FastLED.setMaxPowerInVoltsAndMilliamps(5, 100); // Limitation de Puissance 5V x 200mA
FastLED.clear();
}
void loop() {
FastLED.clear();
for (int i = 0; i < NUM_LEDS+1; i++) {
int cycle = (i / 32) % 4; // toutes les 32 leds sur 4 cycles Red Green Blue White
switch (cycle) {
case 0:
for (int j = 0; j < i; j++) {
leds[j] = CRGB(RED, 0, 0); // Rouge
}
break;
case 1:
for (int j = 0; j < i; j++) {
leds[j] = CRGB(0, GREEN, 0); // Vert
}
break;
case 2:
for (int j = 0; j < i; j++) {
leds[j] = CRGB(0, 0, BLUE); // Bleu
}
break;
case 3:
for (int j = 0; j < i; j++) {
leds[j] = CRGB(RED, GREEN, BLUE); // Blanc
}
break;
}
FastLED.show();
delay(SPEEDELAY);
}
for (int i = 0; i < NUM_LEDS+1; i++) {
leds[i] = CRGB(RED, 0, 0);
}
FastLED.show();
delay(1000);
for (int i = 0; i < NUM_LEDS+1; i++) {
leds[i] = CRGB(0, GREEN, 0);
}
FastLED.show();
delay(1000);
for (int i = 0; i < NUM_LEDS+1; i++) {
leds[i] = CRGB(0, 0, BLUE);
}
FastLED.show();
delay(1000);
for (int i = 0; i < NUM_LEDS+1; i++) {
leds[i] = CRGB(RED, GREEN, BLUE);
}
FastLED.show();
delay(1000);
for (int i = 0; i < NUM_LEDS+1; i++) {
leds[i] = CRGB(0, 0, 0);
}
FastLED.show();
delay(1000);
}
datasheet_1506finalnologo.pdf