Is there any way that an arduino could "self test" how many LEDs are

Is there any way that an arduino could “self test” how many LEDs are connected to it?

I suppose you could have a current sensor connected to your led strip and detect that way.

Thats an idea. I would like to have the program be able to detect how many pixels there are and use that number as the number of LEDs for the programs to use. So i can vonnect as many or as little LEDs as i want and the program would self adjust. Not really a need. Its more of a want lol

Light sensor?
Test routine could turn on one pixel at a time until light sensor stops being triggered.

Thats an even better idea!

Time measure start of reset pulse on pixel 0 to start of reset pulse of last pixel+1 then divide by time of Din to Dout

Ok you lost me there

Loop the end of the strip back to Arduino and measure when the signal propagates, and/or the unique value for that pixel?

@Cristian_Martinez The data of the last pixel gets pushed out the end and you could read that data.

Joel’s idea of a unique value is interesting. Seems like you wouldn’t even need to measure the time of the reset pulse. If you sent a specific color and then repeated something different over and over (and keep track of how many you’ve sent), until you read the unique color come out the Data out on the far end.

Ok i kinda get what youre saying. And it makes sense. But its a bit over my head cuz im still stuck in the basics lol

I built a little test box with a 10 turn pot,

a 4-digit display and outputs connectors for different strips like APA102, WS28xx.
Simple sketch lets one LED blink and shows the LED number.

Just make a voltage divider and measure the voltage over the resistor (measure the current).
Scan one pixel along the chain, and when you get to the end of it, no or little current is measured.

If you get something working i’m interested too