@Ken_White For whatever reason, I see the red spam flag to the top left of your post and a subheader in read “Removed as spam and only visible to you” - very odd. Maybe the dirty 7-letter word “Arduino” was the culprit ; )
I made something like this myself, just to see how the TOF sensor worked. I started out using the strip as a distance meter – basically, mapping the TOF distance from 50-1000 to the length of the strip (say, 0 to 144), and then lighting up that number of LEDs to some fixed color. It’s simple, but fun to play with
I’m using the Pololu library, because even Adafruit, whose breakout-board I’m using, says that Pololu’s is much smaller, faster and better. I got the basics working and first of all try to have a simple buzzer change its buzz repetition frequency according to distance, just like on a car parking assist.
That’s how far I got, the sensor is calibrated to +/- 1 millimetre and the buzzer beeps slower or faster according to distance. Just in case, the code as it is at the moment https://forum.arduino.cc/index.php?topic=557894.0
Now, I have to map the distance to my 1 metre LED strip, the way Marc Miller suggested, making a gradient palette and then accessing it according to distance measured. Seems daunting for a beginner, but should hopefully be educational ; )
Bit of a project diary here, but may be useful for other beginners that want interaction between sensor outputs and LED strips. Found https://gist.github.com/kriegsman/8281905786e8b2632aeb and now, having defined a fairly good visible colour spectrum palette, try to find out how to simplify what I need for using only one palette as in my case. Phew, this is trickier than I thought, although I’m learning in parallel with Jack Purdum’s “Arduino C For Beginners” book.
Ok, thanks for the samples; still struggling a bit with polling the sensor and beeping; something is off there still, as if the beeps are not linearly accelerating as the distance shortens, as if there were discrete plateaus. I have to get that right first, because the in my case rather simple LED reaction depends on the distance measured.