From 27941748c282624dc39d9ca7b64e6abf47415135 Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Tue, 6 Jun 2023 14:38:20 +1000 Subject: [PATCH] Fix NeoPixel/WS2812B timing. - Change frequency from 500kHz to 800kHz to match datasheet. - Updating high & low timings to match make:code. Tested on a variety of WS2812B strips as well as SK6812 RGB and RGBW strips. Signed-off-by: Jim Mussared --- inc/WS2812B.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/WS2812B.h b/inc/WS2812B.h index 3a6deb6..a24967b 100644 --- a/inc/WS2812B.h +++ b/inc/WS2812B.h @@ -32,9 +32,9 @@ DEALINGS IN THE SOFTWARE. #define WS2812B_BUFFER_SIZE 256 #define WS2812B_PAD (0x8000) -#define WS2812B_LOW (0x8000 | 6) -#define WS2812B_HIGH (0x8000 | 10) -#define WS2812B_PWM_FREQ 500000 +#define WS2812B_LOW (0x8000 | 5) // 320ns +#define WS2812B_HIGH (0x8000 | 12) // 760ns +#define WS2812B_PWM_FREQ 800000 #define WS2812B_ZERO_PADDING 50 /** @@ -128,4 +128,4 @@ namespace codal void _play(const void *data, int length, bool mode); }; } -#endif \ No newline at end of file +#endif