#include <FastLED.h>
// pour le forum : https://forum.arduino.cc/t/projet-enseigne-led-geant/1036616/20
#include "Lettre.hpp"
const uint16_t nombreTotalDeLeds = 40 + 20 + 30 + 35 + 50;
const byte dataPin = 2;
CRGB leds[nombreTotalDeLeds];
Phrase<5> phrase(leds, nombreTotalDeLeds);
void setup() {
Serial.begin(115200); Serial.println();
FastLED.addLeds<WS2812B, dataPin, GRB>(leds, nombreTotalDeLeds);
FastLED.setBrightness(50);
phrase.ajouterLettre(0, 'A', 0, 40);
phrase.ajouterLettre(1, 'B', 40, 20);
phrase.ajouterLettre(2, 'C', 60, 30);
phrase.ajouterLettre(3, 'D', 90, 35);
phrase.ajouterLettre(4, 'E', 125, 50);
phrase[0]->allumer(CRGB::Red, false); // false pour effet différé par l'appel à FastLED.show()
phrase[1]->arcEnCiel(1, false);
phrase[2]->gradient(CRGB::Blue, CRGB::Green, false);
FastLED.show();
delay(1000);
phrase.toutEteindre();
phrase[0]->effet(CYCLECOULEUR, false, uint32_t(100)); // uint32_t() très important pour forcer unsigned long
phrase[1]->effet(REMPLISSAGE, false, CRGB::Red, uint32_t(100)); // uint32_t() très important pour forcer unsigned long
phrase[2]->effet(DEPLACEMENT, false, CRGB::Blue, uint32_t(50));
phrase[3]->effet(CHASE, false, CRGB(255, 0, 174), uint32_t(50));
}
void loop() {
phrase.tick();
FastLED.show();
}