But I'd be kinda neat to determine the size dynamically, so I could plug'n'play any of the rings with the same script.
In principle, this should be fairly easy. You just connect the ring's D-Out to an interrupt pin on the Arduino (Pro Mini) and try larger sizes until the bits drop off the end and cause an interrupt.
However, the examples (and my sketch up until now) have the strip constructor function amongst the global declarations, obviating the possibility of creating one with a dynamically determined size.
I tried in the globals declaring:
Code: Select all
Adafruit_NeoPixel *stripPtr;
Code: Select all
stripPtr = &Adafruit_NeoPixel(PIXELS, PIN, NEO_GRB + NEO_KHZ800);
Also, how do you call the destructor function?
I did plenty of C back in the day but never got into C++. Can someone please give me a leg-up?
Regards - Philip