diff --git a/Arduino/McLighting/McLighting.ino b/Arduino/McLighting/McLighting.ino index 707e68a..8e5d7c3 100644 --- a/Arduino/McLighting/McLighting.ino +++ b/Arduino/McLighting/McLighting.ino @@ -149,16 +149,16 @@ WS2812FX* strip = NULL; #endif #if USE_WS2812FX_DMA == 1 // Uses UART1: GPIO1/TXD0/TX, more info: https://github.com/Makuna/NeoPixelBus/wiki/ESP8266-NeoMethods #if !defined(LED_TYPE_WS2811) - dma = new NeoEsp8266Uart0800KbpsMethod(stripSize, ledcolors); //800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) + dma = new NeoEsp8266Uart1800KbpsMethod(stripSize, ledcolors); //800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) #else - dma = new NeoEsp8266Uart0400KbpsMethod(stripSize, ledcolors); //400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) + dma = new NeoEsp8266Uart1400KbpsMethod(stripSize, ledcolors); //400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) #endif #endif #if USE_WS2812FX_DMA == 2 // Uses UART2: GPIO2/TXD1/D4, more info: https://github.com/Makuna/NeoPixelBus/wiki/ESP8266-NeoMethods #if !defined(LED_TYPE_WS2811) - dma = new NeoEsp8266Uart1800KbpsMethod(stripSize, ledcolors); //800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) + dma = new NeoEsp8266Uart0800KbpsMethod(stripSize, ledcolors); //800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) #else - dma = new NeoEsp8266Uart1400KbpsMethod(stripSize, ledcolors); //400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) + dma = new NeoEsp8266Uart0400KbpsMethod(stripSize, ledcolors); //400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) #endif #endif dma->Initialize(); @@ -322,7 +322,7 @@ void initStrip(uint16_t stripSize = WS2812FXStripSettings.stripSize, char RGBOrd #endif strip->setBrightness(brightness); //parameters: index, start, stop, mode, color, speed, options - strip->setSegment(0, 0, WS2812FXStripSettings.stripSize - 1, ws2812fx_mode, hex_colors, convertSpeed(ws2812fx_speed), WS2812FXStripSettings.fxoptions); + strip->setSegment(0, 0, stripSize - 1, ws2812fx_mode, hex_colors, convertSpeed(ws2812fx_speed), fxoptions); #if defined(CUSTOM_WS2812FX_ANIMATIONS) strip->setCustomMode(0, F("Fire 2012"), myCustomEffect0); //strip->setCustomMode(1, F("CustEffect"), myCustomEffect1); diff --git a/Arduino/McLighting/McLighting.ino.nodemcu.bin b/Arduino/McLighting/McLighting.ino.nodemcu.bin index 4911ef4..1755e36 100644 Binary files a/Arduino/McLighting/McLighting.ino.nodemcu.bin and b/Arduino/McLighting/McLighting.ino.nodemcu.bin differ diff --git a/Arduino/McLighting/definitions.h b/Arduino/McLighting/definitions.h index 3db307b..e2154e4 100644 --- a/Arduino/McLighting/definitions.h +++ b/Arduino/McLighting/definitions.h @@ -1,7 +1,7 @@ #define USE_WS2812FX_DMA 0 // 0 = Used PIN is ignored & set to RX/GPIO3; 1 = Used PIN is ignored & set to D4/GPIO2; 2 = Uses PIN is ignored & set to TX/GPIO1; Uses WS2812FX, see: https://github.com/kitesurfer1404/WS2812FX // Neopixel -#define LED_PIN 3 // PIN (15 / D8) where neopixel / WS2811 strip is attached; is configurable just for the start +#define LED_PIN 3 // PIN (15 / D8) where neopixel / WS2811 strip is attached; is configurable, if USE_WS2812FX_DMA is not defined. Just for the start #define NUMLEDS 144 // Number of leds in the; is configurable just for the start #define RGBORDER "GRBW" // RGBOrder; is configurable just for the start #define FX_OPTIONS 56 // ws2812fx Options 56 = SIZE_SMALL + FADE_MEDIUM + GAMMA is configurable just for the start; for WS2812FX setSegment OPTIONS, see: https://github.com/kitesurfer1404/WS2812FX/blob/master/extras/WS2812FX%20Users%20Guide.md diff --git a/Arduino/McLighting/request_handlers.h b/Arduino/McLighting/request_handlers.h index fee0b70..540f02f 100644 --- a/Arduino/McLighting/request_handlers.h +++ b/Arduino/McLighting/request_handlers.h @@ -28,11 +28,11 @@ void handleE131(){ /* #if defined(RGBW) uint16_t multipacketOffset = (universe - START_UNIVERSE) * 128; //if more than 128 LEDs * 4 colors = 512 channels, client will send in next higher universe if (NUMLEDS <= multipacketOffset) return; - uint16_t len = (128 + multipacketOffset > NUMLEDS) ? (NUMLEDS - multipacketOffset) : 128; + uint16_t len = (128 + multipacketOffset > WS2812FXStripSettings.stripSize) ? (WS2812FXStripSettings.stripSize - multipacketOffset) : 128; #else*/ uint16_t multipacketOffset = (universe - START_UNIVERSE) * 170; //if more than 170 LEDs * 3 colors = 510 channels, client will send in next higher universe - if (NUMLEDS <= multipacketOffset) return; - uint16_t len = (170 + multipacketOffset > NUMLEDS) ? (NUMLEDS - multipacketOffset) : 170; + if (WS2812FXStripSettings.stripSize <= multipacketOffset) return; + uint16_t len = (170 + multipacketOffset > WS2812FXStripSettings.stripSize) ? (WS2812FXStripSettings.stripSize - multipacketOffset) : 170; /* #endif */ for (uint16_t i = 0; i < len; i++){ uint16_t j = i * 3;