• I guess digitalPulse could be tweaked so that it scanned over the pulses it was asked to make, and if any were in the microsecond region it just did them by checking the SysTick timer. Seems like quite a bit of effort though.

    neopixelWrite sounds like a good solution really, and then on the WS2811 page we'll mention there's a specific function for ESP8266 (and on the neopixelWrite's docs it can link back to the WS2811 page for how to do it on other platforms).

    Potentially we could do a simple module that looked like:

    exports.connect = function(pin) {
      if (process.env.BOARD.substr(0,7)=="ESP8266­")
        return require("ESP8266").neopixelWrite.bind(nu­ll,pin);
     // otherwise use SPI
     var spi = SPI.find(pin); // can't quite remember
     if (!spi) throw "No SPI MOSI on this pin";
     spi.setup({mosi:pin,baud:3200000);
     return function(data) {
      spi.send4bit(data, 0b0001, 0b0011); 
     };
    }
    

    It's a small waste of memory, but it might make life easier.

About

Avatar for Gordon @Gordon started