From 3960ca6258fcabfa277cf358a08136984b6542a2 Mon Sep 17 00:00:00 2001 From: phleech Date: Mon, 16 Oct 2023 23:57:11 +0100 Subject: [PATCH] Bugfix: correcting bitshift order to match ws2811 spec --- src/esp32WS2811.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/esp32WS2811.cpp b/src/esp32WS2811.cpp index 7285cbf..9a09976 100644 --- a/src/esp32WS2811.cpp +++ b/src/esp32WS2811.cpp @@ -211,8 +211,8 @@ void WS2811::_handleRmt(WS2811* ws2811) { currentItem = &rmtItems[0]; if (xSemaphoreTake(ws2811->_smphr, 100) == pdTRUE) { for (size_t i = 0; i < ws2811->_numLeds; ++i) { - uint32_t currentPixel = ws2811->_leds[i].green << 16 | - ws2811->_leds[i].red << 8 | + uint32_t currentPixel = ws2811->_leds[i].red << 16 | + ws2811->_leds[i].green << 8 | ws2811->_leds[i].blue; for (int8_t j = 23; j >= 0; --j) { // We have 24 bits of data representing the red, green and blue channels. The value of the