|
@@ -78,25 +78,46 @@ bool readSDFile() {
|
|
|
}
|
|
|
|
|
|
else if (selector == "led") {
|
|
|
- Serial.println("led");
|
|
|
-// String mode = getSubstring(buf, ' ', 1);
|
|
|
-// if (mode == "L"){
|
|
|
+ //Serial.println("led");
|
|
|
+ String zone = getSubstring(buf, ' ', 1);
|
|
|
+ String palette = getSubstring(buf, ' ', 2);
|
|
|
+ String bright = getSubstring(buf, ' ', 3);
|
|
|
+ String fadeTime = getSubstring(buf, ' ', 4);
|
|
|
+
|
|
|
+ if (zone == "lustre"){
|
|
|
+ if (palette = "MER"){lustre_targetPalette = palette_MER ;}
|
|
|
+ else if (palette = "SOLEIL"){lustre_targetPalette = palette_SOLEIL ;}
|
|
|
+ else if (palette = "CREPUSCULE"){lustre_targetPalette = palette_CREPUSCULE ;}
|
|
|
+ else if (palette = "FLAMINGO"){lustre_targetPalette = palette_FLAMINGO ;}
|
|
|
+ lustre_targetBrightness = bright.toInt();
|
|
|
+ lustre_stepBrightness = 10 * (lustre_targetBrightness - lustre_currentBrightness) / (float)(fadeTime.toInt()/refreshRate) ;
|
|
|
+ Serial.print ("LEDS : palette ");
|
|
|
+ Serial.print (palette);
|
|
|
+ Serial.print (" - brightness : ");
|
|
|
+ Serial.print (lustre_targetBrightness);
|
|
|
+ Serial.print (" - fade time : ");
|
|
|
+ Serial.print (fadeTime);
|
|
|
+ Serial.print (" - steps : ");
|
|
|
+ Serial.println (lustre_stepBrightness);
|
|
|
+ }
|
|
|
+
|
|
|
+// if(
|
|
|
// int R = getSubstring(buf, ' ', 2).toInt();
|
|
|
// int G = getSubstring(buf, ' ', 3).toInt();
|
|
|
// int B = getSubstring(buf, ' ', 4).toInt();
|
|
|
// for (int i ; i<NUM_LEDS_LUSTRE ; i++) {
|
|
|
// lustreLeds[i].setRGB(R, G, B) ;
|
|
|
// }
|
|
|
-// }
|
|
|
-// if (mode == "T"){
|
|
|
+
|
|
|
+ if (zone == "table"){
|
|
|
// int R = getSubstring(buf, ' ', 2).toInt();
|
|
|
// int G = getSubstring(buf, ' ', 3).toInt();
|
|
|
// int B = getSubstring(buf, ' ', 4).toInt();
|
|
|
// for (int i ; i<NUM_LEDS_TABLE ; i++) {
|
|
|
// tableLeds[i].setRGB(R, G, B) ;
|
|
|
// }
|
|
|
-// }
|
|
|
-// Serial.println("Led mode " + getSubstring(buf, ' ', 1));
|
|
|
+ }
|
|
|
+ //Serial.println("Led mode " + getSubstring(buf, ' ', 1));
|
|
|
}
|
|
|
|
|
|
else if (selector == "dimmer") {
|