WIP : test cylon progressif
This commit is contained in:
parent
606a442777
commit
04af91f5d3
@ -166,34 +166,74 @@ void ledBlackAll()
|
|||||||
FastLED.show();
|
FastLED.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO : faudra sortir toutes ces fonctions dans un autre fichier
|
||||||
|
|
||||||
void ledCylon()
|
void ledCylon()
|
||||||
{
|
{
|
||||||
// Effet cylon : on allume une led, on attends, on eteinds, on passe à la suivante
|
// Effet cylon : on allume une led, on attends, on eteinds, on passe à la suivante
|
||||||
for(int i = 0; i < LED_NUM; i++) {
|
for(int i = 0; i < LED_NUM; i++) {
|
||||||
client.loop();
|
client.loop();
|
||||||
|
|
||||||
if (ledEffect != LED_EFFECT_CYLON) {
|
if (ledEffect != LED_EFFECT_CYLON) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((i - 3) >= 0) {
|
||||||
|
leds[i - 3] = CRGB::Black;
|
||||||
|
}
|
||||||
|
if ((i - 2) >= 0) {
|
||||||
|
/*
|
||||||
|
* Se lit 204/256 d'intensité lumineuse
|
||||||
|
* àhttps://github.com/FastLED/FastLED/wiki/Pixel-reference#dimming-and-brightening-colors
|
||||||
|
*/
|
||||||
|
leds[i - 2] %= 204;
|
||||||
|
}
|
||||||
|
if ((i - 2) >= 1) {
|
||||||
|
leds[i - 2] %= 153;
|
||||||
|
}
|
||||||
|
|
||||||
leds[i] = color;
|
leds[i] = color;
|
||||||
FastLED.delay(1000 / speed);
|
|
||||||
leds[i] = CRGB::Black;
|
if ((i + 1) <= LED_NUM) {
|
||||||
|
leds[i - 2] %= 153;
|
||||||
|
}
|
||||||
|
if ((i + 2) <= LED_NUM) {
|
||||||
|
leds[i - 2] %= 204;
|
||||||
|
}
|
||||||
|
|
||||||
FastLED.delay(1000 / speed);
|
FastLED.delay(1000 / speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// led[0] et led[255] sont gérées par la loop précédante
|
||||||
for(int i = LED_NUM - 1; i > 0; i--) {
|
for(int i = LED_NUM - 1; i > 0; i--) {
|
||||||
client.loop();
|
client.loop();
|
||||||
if (ledEffect != LED_EFFECT_CYLON) {
|
|
||||||
return;
|
if ((i - 2) >= 0) {
|
||||||
|
/*
|
||||||
|
* Se lit 204/256 d'intensité lumineuse
|
||||||
|
* àhttps://github.com/FastLED/FastLED/wiki/Pixel-reference#dimming-and-brightening-colors
|
||||||
|
*/
|
||||||
|
leds[i - 2] %= 204;
|
||||||
|
}
|
||||||
|
if ((i - 2) >= 1) {
|
||||||
|
leds[i - 2] %= 153;
|
||||||
}
|
}
|
||||||
|
|
||||||
leds[i] = color;
|
leds[i] = color;
|
||||||
FastLED.delay(1000 / speed);
|
|
||||||
leds[i] = CRGB::Black;
|
if ((i + 1) <= LED_NUM) {
|
||||||
FastLED.show();
|
leds[i - 2] %= 153;
|
||||||
}
|
}
|
||||||
|
if ((i + 2) <= LED_NUM) {
|
||||||
|
leds[i - 2] %= 204;
|
||||||
|
}
|
||||||
|
if ((i + 3) <= LED_NUM) {
|
||||||
|
leds[i - 3] = CRGB::Black;
|
||||||
|
}
|
||||||
|
|
||||||
FastLED.delay(1000 / speed);
|
FastLED.delay(1000 / speed);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ledError()
|
void ledError()
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user