diff --git a/Software_Installation.md b/Software_Installation.md index e1fe52b02a09a5da67c68c28545fa27e4731be83..93f0867d4ab1eb547a97158b251d85ebd8103463 100644 --- a/Software_Installation.md +++ b/Software_Installation.md @@ -63,7 +63,7 @@ The video wasn't updated for the new update, so the library versions are incorre  8. *(Optional)* Install ArduinoOTA for flashing the ESP8266 via WiFi (requires Python 2.7) - Click on *Sketch >> Include Library >> Manage Libraries* and install **Espalexa, version 2.4.4** + Click on *Sketch >> Include Library >> Manage Libraries* and install **ArduinoOTA**  @@ -111,7 +111,7 @@ The video wasn't updated for the new update, so the library versions are incorre  5. Configure the main parameters - In the .ino file there are many parameters to change and tweak the essential settings are: + In the esp8266-fastled-iot-webserver.ino file there are many parameters to change and tweak the essential settings are: - `LED_TYPE`: The type of LED strip that is used (WS2812B, APA102, ...) - `DATA_PIN`: The pin where the LED-Strip is connected - `CLK_PIN`: Additional clock pin when using LED-Strips with 4 pins. @@ -171,7 +171,7 @@ This type is used for the [twisted](https://www.thingiverse.com/thing:4129249) o Parameters: - `LINE_COUNT`: Amount of the LED strip lines, (with the provided cores it's 8) -- `PIXELS_PER_LEAF`: Amount of the LEDs inside one triangle +- `LEDS_PER_LINE`: Amount of the LEDs inside one triangle #### 2.2.4 [4] Nanoleaf Replica @@ -180,7 +180,7 @@ This type is used for the [3D-Printed Nanoleafs](https://www.thingiverse.com/thi Parameters: - `LEAFCOUNT`: Amount of the LED strip lines, (with the provided cores it's 8) -- `LEDS_PER_LINE`: Amount of the LEDs per strip +- `PIXELS_PER_LEAF`: Amount of the LEDs per strip #### 2.2.5 [5] Animated RGB-Logos diff --git a/esp8266-fastled-iot-webserver.ino b/esp8266-fastled-iot-webserver.ino index 85ca6ffe21a4d4e932e1fdb57ec4e85a64d8a0f3..fa1e0e2116303c15efd4b817c985000d265c5330 100644 --- a/esp8266-fastled-iot-webserver.ino +++ b/esp8266-fastled-iot-webserver.ino @@ -623,7 +623,7 @@ const String paletteNames[paletteCount] = { -void setSolidColor(uint8_t r, uint8_t g, uint8_t b, bool updatePattern = true) +void setSolidColor(uint8_t r, uint8_t g, uint8_t b, bool updatePattern) { solidColor = CRGB(r, g, b); @@ -637,7 +637,7 @@ void setSolidColor(uint8_t r, uint8_t g, uint8_t b, bool updatePattern = true) broadcastString("color", String(solidColor.r) + "," + String(solidColor.g) + "," + String(solidColor.b)); } -void setSolidColor(CRGB color, bool updatePattern = true) +void setSolidColor(CRGB color, bool updatePattern) { setSolidColor(color.r, color.g, color.b, updatePattern); } @@ -662,7 +662,7 @@ void handleReboot2() } #endif // ENABLE_ALEXA_SUPPORT -void addRebootPage(int webServerNr = 0) +void addRebootPage(int webServerNr) { if (webServerNr < 2) { @@ -1771,8 +1771,8 @@ void addGlitter(uint8_t chanceOfGlitter) extern const TProgmemRGBGradientPalettePtr gGradientPalettes[]; extern const uint8_t gGradientPaletteCount; -uint8_t beatsaw8(accum88 beats_per_minute, uint8_t lowest = 0, uint8_t highest = 255, - uint32_t timebase = 0, uint8_t phase_offset = 0) +uint8_t beatsaw8(accum88 beats_per_minute, uint8_t lowest, uint8_t highest, + uint32_t timebase, uint8_t phase_offset) { uint8_t beat = beat8(beats_per_minute, timebase); uint8_t beatsaw = beat + phase_offset; @@ -2570,7 +2570,7 @@ bool parseUdp() //############################## Misc -int getVolume(uint8_t vals[], int start, int end, double factor = 1.0) +int getVolume(uint8_t vals[], int start, int end, double factor) { int result = 0; int iter = 0; @@ -2604,8 +2604,8 @@ void BrightnessVisualizer() if (!parseUdp())return; //if (incomingPacket[0] != 0) - currentVolume = getVolume(incomingPacket, BAND_START, BAND_END); - avgVolume = getVolume(lastVals, 0, AVG_ARRAY_SIZE - 1); + currentVolume = getVolume(incomingPacket, BAND_START, BAND_END, 1); + avgVolume = getVolume(lastVals, 0, AVG_ARRAY_SIZE - 1, 1); if (avgVolume != 0)cd = ((double)currentVolume) / ((double)avgVolume); //Serial.printf("%d, %d, %lf\n", currentVolume, avgVolume, cd); if (currentVolume < 30)cd = 0; @@ -2668,8 +2668,8 @@ void TrailingBulletsVisualizer() ShiftLeds(1); return; } - currentVolume = getVolume(incomingPacket, BAND_START, BAND_END); - avgVolume = getVolume(lastVals, 0, AVG_ARRAY_SIZE - 1); + currentVolume = getVolume(incomingPacket, BAND_START, BAND_END, 1); + avgVolume = getVolume(lastVals, 0, AVG_ARRAY_SIZE - 1, 1); if (avgVolume != 0)cd = ((double)currentVolume) / ((double)avgVolume); if (currentVolume < 25)cd = 0; if (currentVolume > 230) cd += 0.15; @@ -2717,7 +2717,7 @@ CHSV getVisualizerBulletValue(int hue, double cd) -void vuMeter(CHSV c, int mode = 0) +void vuMeter(CHSV c, int mode) { int vol = getVolume(incomingPacket, BAND_START, BAND_END, 1.75); fill_solid(leds, NUM_LEDS, CRGB::Black); @@ -2856,7 +2856,7 @@ void vuMeterSolid() fadeToBlackBy(leds, NUM_LEDS, 5); return; } - vuMeter(rgb2hsv_approximate(solidColor)); + vuMeter(rgb2hsv_approximate(solidColor), 0); } void vuMeterStaticRainbow() @@ -2886,7 +2886,7 @@ void vuMeterFading() fadeToBlackBy(leds, NUM_LEDS, 5); return; } - vuMeter(CHSV(gHue, 255, 255)); + vuMeter(CHSV(gHue, 255, 255), 0); } void NanoleafWaves() @@ -2904,8 +2904,8 @@ void NanoleafWaves() ShiftLeds(1); return; } - currentVolume = getVolume(incomingPacket, BAND_START, BAND_END); - avgVolume = getVolume(lastVals, 0, AVG_ARRAY_SIZE - 1); + currentVolume = getVolume(incomingPacket, BAND_START, BAND_END, 1); + avgVolume = getVolume(lastVals, 0, AVG_ARRAY_SIZE - 1, 1); if (avgVolume != 0)cd = ((double)currentVolume) / ((double)avgVolume); if (currentVolume < 25)cd = 0; if (currentVolume > 230) cd += 0.15; @@ -2948,8 +2948,8 @@ void RefreshingVisualizer() ShiftLeds(1); return; } - currentVolume = getVolume(incomingPacket, BAND_START, BAND_END); - avgVolume = getVolume(lastVals, 0, AVG_ARRAY_SIZE - 1); + currentVolume = getVolume(incomingPacket, BAND_START, BAND_END, 1); + avgVolume = getVolume(lastVals, 0, AVG_ARRAY_SIZE - 1, 1); if (avgVolume != 0)cd = ((double)currentVolume) / ((double)avgVolume); if (currentVolume < 25)cd = 0; if (currentVolume > 230) cd += 0.15; @@ -2992,8 +2992,8 @@ void DualToneBullets(int hueA, int hueB, int grpsz) ShiftLeds(1); return; } - currentVolume = getVolume(incomingPacket, BAND_START, BAND_END); - avgVolume = getVolume(lastVals, 0, AVG_ARRAY_SIZE - 1); + currentVolume = getVolume(incomingPacket, BAND_START, BAND_END, 1); + avgVolume = getVolume(lastVals, 0, AVG_ARRAY_SIZE - 1, 1); if (avgVolume != 0)cd = ((double)currentVolume) / ((double)avgVolume); if (currentVolume < 25)cd = 0; if (currentVolume > 230) cd += 0.15; @@ -3053,7 +3053,7 @@ void BluePurpleBullets() { DualToneBullets(240, 170, BULLET_COLOR_SIZE); } -int expo(double x, double start = 0) +int expo(double x, double start) { double res = 10.0 * (pow(1.02, x)) - 10.0 + start; if (res > 255)res = 255; @@ -3061,7 +3061,7 @@ int expo(double x, double start = 0) return (int)res; } -void Band(int grpSize, CRGB x, int mergePacket = 1) +void Band(int grpSize, CRGB x, int mergePacket) { if (!parseUdp()) { @@ -3134,8 +3134,8 @@ void BulletVisualizer() return; } //if (incomingPacket[0] != 0) - currentVolume = getVolume(incomingPacket, BAND_START, BAND_END); - avgVolume = getVolume(lastVals, 0, AVG_ARRAY_SIZE - 1); + currentVolume = getVolume(incomingPacket, BAND_START, BAND_END, 1); + avgVolume = getVolume(lastVals, 0, AVG_ARRAY_SIZE - 1, 1); if (avgVolume != 0)cd = ((double)currentVolume) / ((double)avgVolume); if (currentVolume < 25)cd = 0; if (currentVolume > 230) cd += 0.15; @@ -3179,8 +3179,8 @@ void CentralVisualizer() ShiftLedsCenter(1); return; } - currentVolume = getVolume(incomingPacket, BAND_START, BAND_END); - avgVolume = getVolume(lastVals, 0, AVG_ARRAY_SIZE - 1); + currentVolume = getVolume(incomingPacket, BAND_START, BAND_END, 1); + avgVolume = getVolume(lastVals, 0, AVG_ARRAY_SIZE - 1, 1); if (avgVolume != 0)cd = ((double)currentVolume) / ((double)avgVolume); if (currentVolume < 25)cd = 0; if (currentVolume > 230) cd += 0.15;