Node JS with BlinkStick Flex Only Controls 4 LEDs at a Time

I’m having a hard time controlling more than 4 LEDs at a time. If I do, the hardware usually doesn’t respond correctly. I’m using the pulse method, and usually I can get all of them to fade on correctly, but they’ll then some will fade out correctly, others will stay fully lit, sometimes I get an LED that goes yellow (I have them all set to “white”), but they have to be reset by running the pro_runner example set to cycle through all 32 LEDs.

Honestly, I didn’t think my project was going to be that tough. I’m trying to build a TARDIS from Doctor Who for a library event, and wanted to trigger the LEDs at the same time I trigger an MP3. All I want is to pulse the whole strip of 32 LEDs on and off a few times, wait, then do it again. But, as soon as I add a 5th LED to trigger simultaneously, it breaks. I’ve looked through the methods, there doesn’t seem to be a way to select all the LEDs, other than pointing to each individual index, unless I’m missing something.

Here’s some demo code I’m using:

var blinkstick = require('blinkstick'),
    led = blinkstick.findFirst();

if (led) {
    led.pulse('#FFFFFF', {'index': 0, 'duration': 2000}, function() {
        led.turnOff();
    })
    led.pulse('#FFFFFF', { 'index': 1, 'duration': 2000 }, function () {
        led.turnOff();
    })
    led.pulse('#FFFFFF', { 'index': 2, 'duration': 2000 }, function () {
        led.turnOff();
    })
    led.pulse('#FFFFFF', { 'index': 3, 'duration': 2000 }, function () {
        led.turnOff();
    })
}

I don’t know a thing about Node but if I had to guess what’s going on I’d say you’re overwhelming the BlinkStick. It needs a little wait time between commands, odds are 5 LEDs are the tipping point where there’s too many commands to keep up with. I’d rip the morph code and write your own function that uses setColors so you can set all LEDs at once with a single command instead of running around settings all LEDs individually.