diff --git a/CHANGELOG.md b/CHANGELOG.md index cbc45e927..631162c7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ### Development versions after 0.9.1 release +#### Build 2003211 + +- Added custom mapping compile define to FX_fcn.h +- Merged pull request #784 by @TravisDean: Fixed initialization bug when toggling skip first +- Added link to youtube videos by Room31 to readme #### Build 2003141 diff --git a/readme.md b/readme.md index c796ca5c9..53671c6b9 100644 --- a/readme.md +++ b/readme.md @@ -50,6 +50,10 @@ DrZzs has made some excellent video guides: If you'd rather read, here is a very [detailed step-by-step beginner tutorial](https://tynick.com/blog/11-03-2019/getting-started-with-wled-on-esp8266/) by tynick! +Russian speakers, check out the videos by Room31: +[WLED Firmware Overview: Interface and Settings](https://youtu.be/h7lKsczEI7E) +[ESP8266 based LED controller for WS2812b strip. WLED Firmware + OpenHAB](https://youtu.be/K4ioTt3XvGc) + ### Other Licensed under the MIT license diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 59f69da4d..7bc02defb 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -27,13 +27,30 @@ #include "FX.h" #include "palettes.h" +//enable custom per-LED mapping. This can allow for better effects on matrices or special displays +//#define WLED_CUSTOM_LED_MAPPING + +#ifdef WLED_CUSTOM_LED_MAPPING +//this is just an example (30 LEDs). It will first set all even, then all uneven LEDs. +const uint16_t customMappingTable[] = { + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29}; + +//another example. Switches direction every 5 LEDs. +/*const uint16_t customMappingTable[] = { + 0, 1, 2, 3, 4, 9, 8, 7, 6, 5, 10, 11, 12, 13, 14, + 19, 18, 17, 16, 15, 20, 21, 22, 23, 24, 29, 28, 27, 26, 25};*/ + +const uint16_t customMappingSize = sizeof(customMappingTable)/sizeof(uint16_t); //30 in example +#endif + void WS2812FX::init(bool supportWhite, uint16_t countPixels, bool skipFirst) { - if (supportWhite == _useRgbw && countPixels == _length) return; + if (supportWhite == _useRgbw && countPixels == _length && _skipFirstMode == skipFirst) return; RESET_RUNTIME; _useRgbw = supportWhite; - _skipFirstMode = skipFirst; _length = countPixels; + _skipFirstMode = skipFirst; uint8_t ty = 1; if (supportWhite) ty = 2; @@ -142,10 +159,16 @@ void WS2812FX::setPixelColor(uint16_t i, byte r, byte g, byte b, byte w) int16_t indexSet = realIndex + (reversed ? -j : j); int16_t indexSetRev = indexSet; if (reverseMode) indexSetRev = _length - 1 - indexSet; + #ifdef WLED_CUSTOM_LED_MAPPING + if (indexSet < customMappingSize) indexSet = customMappingTable[indexSet]; + #endif if (indexSetRev >= SEGMENT.start && indexSetRev < SEGMENT.stop) bus->SetPixelColor(indexSet + skip, col); } } else { //live data, etc. if (reverseMode) i = _length - 1 - i; + #ifdef WLED_CUSTOM_LED_MAPPING + if (i < customMappingSize) i = customMappingTable[i]; + #endif bus->SetPixelColor(i + skip, col); } if (skip && i == 0) { @@ -430,7 +453,13 @@ uint32_t WS2812FX::getColor(void) { uint32_t WS2812FX::getPixelColor(uint16_t i) { - i = realPixelIndex(i) + (_skipFirstMode ? LED_SKIP_AMOUNT : 0); + i = realPixelIndex(i); + + #ifdef WLED_CUSTOM_LED_MAPPING + if (i < customMappingSize) i = customMappingTable[i]; + #endif + + if (_skipFirstMode) i += LED_SKIP_AMOUNT; if (_cronixieMode) { diff --git a/wled00/NpbWrapper.h b/wled00/NpbWrapper.h index 71367d980..673d82492 100644 --- a/wled00/NpbWrapper.h +++ b/wled00/NpbWrapper.h @@ -4,7 +4,7 @@ //PIN CONFIGURATION #ifndef LEDPIN -#define LEDPIN 2 //strip pin. Any for ESP32, gpio2 or 3 is recommended for ESP8266 (gpio2/3 are labeled D4/RX on NodeMCU and Wemos) +#define LEDPIN 2 //strip pin. Any for ESP32, gpio2 or 3 is recommended for ESP8266 (gpio2/3 are labeled D4/RX on NodeMCU and Wemos) #endif //#define USE_APA102 // Uncomment for using APA102 LEDs. //#define USE_WS2801 // Uncomment for using WS2801 LEDs (make sure you have NeoPixelBus v2.5.6 or newer) diff --git a/wled00/html_settings.h b/wled00/html_settings.h index c7badc16f..266016959 100644 --- a/wled00/html_settings.h +++ b/wled00/html_settings.h @@ -284,9 +284,9 @@ Send notifications twice:

Realtime

Receive UDP realtime:

E1.31 (sACN)
-Skip out-of-sequence packets (freeze instead of flicker):
Use E1.31 multicast:
E1.31 start universe:
+Skip out-of-sequence packets:
Reboot required. Check out LedFx!
DMX start address:
DMX mode: diff --git a/wled00/wled00.ino b/wled00/wled00.ino index f9648dcf1..69517073c 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -119,7 +119,7 @@ #endif //version code in format yymmddb (b = daily build) -#define VERSION 2003141 +#define VERSION 2003211 char versionString[] = "0.9.1";