Added "Effect" AM_STATIC ("static") and some more colors.
This commit is contained in:
parent
40efeee436
commit
8fe03313ac
@ -24,7 +24,8 @@ enum AnimationMode {
|
||||
AM_FLASH,
|
||||
AM_OFF,
|
||||
AM_ERROR,
|
||||
AM_NONE
|
||||
AM_NONE,
|
||||
AM_STATIC
|
||||
};
|
||||
|
||||
extern AnimationMode mode;
|
||||
|
@ -216,10 +216,9 @@ void loop() {
|
||||
nodes[0]->blend_to(((millis() / 1000) % 2 == 0) ? CRGB::Black : color, 0, 64);
|
||||
}
|
||||
|
||||
} else if (active_mode == AM_OFF) {
|
||||
LOGln("Blanking.");
|
||||
} else if (active_mode == AM_OFF || active_mode == AM_STATIC) {
|
||||
for(Node* node : nodes) {
|
||||
node->set_color(CRGB::Black);
|
||||
node->set_color(active_mode == AM_OFF ? CRGB::Black : color);
|
||||
node->draw();
|
||||
}
|
||||
} else { // This includes AM_ERROR
|
||||
|
@ -50,6 +50,7 @@ void callback(char* topic, byte* pl, unsigned int length) {
|
||||
else if (value.equals("first_corner")) { new_mode = AM_FIRST_CORNER; }
|
||||
else if (value.equals("off")) { new_mode = AM_OFF; }
|
||||
else if (value.equals("flash")) { new_mode = AM_FLASH; }
|
||||
else if (value.equals("static")) { new_mode = AM_STATIC; }
|
||||
else { LOGln("Unknown mode '%s'.", value.c_str()); }
|
||||
} else if (key.equals("duration")) {
|
||||
duration = value.toInt();
|
||||
@ -62,6 +63,9 @@ void callback(char* topic, byte* pl, unsigned int length) {
|
||||
if (value.equals("red")) { color = CRGB::Red; }
|
||||
else if (value.equals("green")) { color = CRGB::Green; }
|
||||
else if (value.equals("blue")) { color = CRGB::Blue; }
|
||||
else if (value.equals("pink")) { color = CRGB::Pink; }
|
||||
else if (value.equals("yellow")) { color = CRGB::Yellow; }
|
||||
else if (value.equals("orange")) { color = CRGB::Orange; }
|
||||
else { LOGln("Unknown color name %s.", value.c_str());}
|
||||
} else {
|
||||
LOGln("Unknown key '%s'. (For reference: Value is '%s'.)", key.c_str(), value.c_str());
|
||||
|
Loading…
Reference in New Issue
Block a user