ajfisher / node-pixel

Library for using addressable LEDs (such as NeoPixels/WS2812) with Firmata and JohnnyFive
MIT License
275 stars 71 forks source link

Update whole strip with array of colors? #240

Open peteruithoven opened 3 years ago

peteruithoven commented 3 years ago

With the current API to update each pixel you need to call color per pixel (e.g. strip.pixel(i).color(rgb);), this also requires one or more messages per pixel update. Isn't there a way to update the whole strip with an array of colors? Simple example:

const colors = [
  [255,0,0]
  [0,255,0]
  [0,0,255]
]
strip.color(colors);

If it's possible to send this with fewer messages this could improve the communication though put? (Downside is that you lose the possibility to only update the leds that need to change).