JoDaNl / esp8266_ws2812_i2s

ESP8266 Library for driving WS2812 led-strip using the I2S output. Use within the Arduino IDE
71 stars 24 forks source link

Cannot disable dithering #7

Open scottlawsonbc opened 7 years ago

scottlawsonbc commented 7 years ago

The default settings in ws2812.h are:

// ws2812.h 

#ifndef __WS2812_H__
#define __WS2812_H__

#define WS2812_GAMMA_CORRECTION (1)         // 0 = off, 1=on (I might change this in the near
                                            // future to support different gamma curves) 
#define WS2812_DITHER_NUM       (8)         // 1, 2, 4, 8  (1 = no dithering)
#define WS2812_USE_INTERRUPT    (0)         // not supported yet

#endif

// end of file

I get a compilation error (shown below) when I try to set WS2812_DITHER_NUM to 1, 2, or 4.

C:\Users\Scott\Documents\Arduino\libraries\esp8266_ws2812_i2s-master\src\ws2812_gamma.cpp:155:106: error: too many initializers for 'const uint8_t* [2] {aka const unsigned char* [2]}'
 const uint8_t *gamma_dither[WS2812_DITHER_NUM] = {gamma0,gamma1,gamma2,gamma3,gamma4,gamma5,gamma6,gamma7};
                                                                                                          ^
Error compiling.

The comment says 1 = no dithering, but I am not sure what the values 2 and 4 do.

Any idea how to fix this? I noticed some flickering in my LEDs and want to try disabling dithering.

himijendrix24 commented 7 years ago

if you change it to anything else than 8 the gamma_dither[] array will be defined as an array with 1,2 or 4 elements but actually contains 8. Just delete the other elements and it will compile. I have no WS2811/12 for testing this. const uint8_t *gamma_dither[WS2812_DITHER_NUM] = {gamma0};

Update: Seems to be more complicated. I use this library together with this ArtNet Library: rstephan It compiles, but as soon as I send ArtNet data the esp-12 prints an exception(28) error and resets. Without changing the dither it works, but when sending on more than 300 channels simultaneously, the esp-12 resets.