ajout de colortemp
This commit is contained in:
parent
a8c09dd27b
commit
4e0c1ff950
@ -312,6 +312,36 @@ void SetupPurpleAndGreenPalette()
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////// ColorTemperature
|
||||||
|
void colorTemp()
|
||||||
|
{
|
||||||
|
// draw a generic, no-name rainbow
|
||||||
|
static uint8_t starthue = 0;
|
||||||
|
fill_rainbow( leds + 5, LED_NUM - 5, --starthue, 20);
|
||||||
|
|
||||||
|
// Choose which 'color temperature' profile to enable.
|
||||||
|
uint8_t secs = (millis() / 1000) % (DISPLAYTIME * 2);
|
||||||
|
if( secs < DISPLAYTIME) {
|
||||||
|
FastLED.setTemperature( TEMPERATURE_1 ); // first temperature
|
||||||
|
leds[0] = TEMPERATURE_1; // show indicator pixel
|
||||||
|
} else {
|
||||||
|
FastLED.setTemperature( TEMPERATURE_2 ); // second temperature
|
||||||
|
leds[0] = TEMPERATURE_2; // show indicator pixel
|
||||||
|
}
|
||||||
|
|
||||||
|
// Black out the LEDs for a few secnds between color changes
|
||||||
|
// to let the eyes and brains adjust
|
||||||
|
if( (secs % DISPLAYTIME) < BLACKTIME) {
|
||||||
|
memset8( leds, 0, LED_NUM * sizeof(CRGB));
|
||||||
|
}
|
||||||
|
|
||||||
|
FastLED.show();
|
||||||
|
FastLED.delay(8);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
void loop() {
|
void loop() {
|
||||||
// MQTT
|
// MQTT
|
||||||
testConnectMQTT();
|
testConnectMQTT();
|
||||||
@ -325,8 +355,10 @@ void loop() {
|
|||||||
ledCylon();
|
ledCylon();
|
||||||
} else if (ledEffect == LED_EFFECT_FULLRED) {
|
} else if (ledEffect == LED_EFFECT_FULLRED) {
|
||||||
ledFullColor();
|
ledFullColor();
|
||||||
} else if (ledEffect == LED_EFFET_COLORPATTERN) {
|
} else if (ledEffect == LED_EFFECT_COLORPATTERN) {
|
||||||
ledColorPattern();
|
ledColorPattern();
|
||||||
|
} else if (ledEffect == LED_EFFECT_COLORTEMP) {
|
||||||
|
colorTemp();
|
||||||
} else {
|
} else {
|
||||||
ledError();
|
ledError();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user