|
|
|
@ -41,7 +41,7 @@ void setup() |
|
|
|
ledEffect = LED_EFFECT_ERROR; |
|
|
|
ledState = false; |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
LEDS.addLeds<LED_CHIPSET,LED_PIN, LED_COLOR_ORDER>(leds, LED_NUM).setCorrection(TypicalSMD5050); |
|
|
|
ledBlackAll(); |
|
|
|
FastLED.setBrightness(brightness); |
|
|
|
@ -324,17 +324,14 @@ void ledError() |
|
|
|
*/ |
|
|
|
void ledFullColor() |
|
|
|
{ |
|
|
|
fill_solid(leds, LED_NUM, color); |
|
|
|
// TODO : il fadrait pas faire 0 -> 255 mais plutot 20 (ou plus) -> brightness
|
|
|
|
// Source : http://sean.voisen.org/blog/2011/10/breathing-led-with-arduino/
|
|
|
|
// Augmenter 2000 augmente la fréquence (c'est en fait sin((temps / 1000) * Pi/2)
|
|
|
|
// 0.36787944 ?? censé correspondre au minimum
|
|
|
|
// 108.4 ?? censé correspondre au maximum
|
|
|
|
int breath = (exp(sin(millis() / 2000.0 * PI)) - 0.3678794) * 108.4; |
|
|
|
//Serial.print(breath);
|
|
|
|
//Serial.println(" / 255");
|
|
|
|
float breath = (exp(sin(millis() / 2000.0 * map(speed, 0, 255, 50, 300)/100 * PI)) - 0.3678794) * 108.4; |
|
|
|
|
|
|
|
// En dessous de 3 les leds paraissent éteintes
|
|
|
|
breath = map(breath, 0, 255, 3, brightness); |
|
|
|
FastLED.setBrightness(breath); |
|
|
|
FastLED.delay(100 / speed); |
|
|
|
fill_solid(leds, LED_NUM, color); |
|
|
|
FastLED.delay(1); |
|
|
|
} |
|
|
|
|
|
|
|
///////////////////// FastLED-3.1.5/examples/ColorPalette /////////////////////
|
|
|
|
|