adafruit / Adafruit_NeoPixel

Arduino library for controlling single-wire LED pixels (NeoPixel, WS2812, etc.)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automatically get the number of leds

stoneWeb opened this issue · comments

commented

Is there a way to automatically get the number of leds without setting a const variable?
Because I want to be able to access different numbers of light strips without having to re-modify the code.

Sorry. There is not. NeoPixels have no notion of how many neighbors they have, or how many total pixels exist, etc.. They simply strip off the first chunk of data in the stream, use it for themselves, and pass everything else along.