// ws2812_lib.cpp // // main library file / contains class implementation // // Need to give credits to Charles Lohr (https://github.com/cnlohr due // to his work on his software for driving ws2812 led-strips using // the i2s interface of the ESP8266. // // This inspired me to create an ESP8266 library for the Arduino IDE // I've added temporal dithering & gamma-correction // for a 'more natural' light intensity profile. // // No pin-definitions/mapings are required/possible as the library used the I2S // output-pin. This pin in it's turn is shared with GPIO3 & RXD0 // #include #include #include "ws2812_i2s.h" #include "ws2812_defs.h" #include "ws2812_gamma.h" // include C-style header extern "C" { #include "ws2812_dma.h" }; // class constructor WS2812::WS2812(void) { // empty for now } // class de-constructor WS2812::~WS2812(void) { // empty for now // TODO : should implement switching of DMA } // Init led-string / memory buffers etc. void WS2812::init(uint16_t _num_leds) { uint8_t i; uint16_t j; num_leds = _num_leds; // clear zero buffer for(j=0; j>4) & 0x0f ]; } } } // end of file