I have an array of NeoPixels and would
send the whole array to a function.
It works fine if i send one array element "as pointer" but
i would like to send the whole arrays as pointer.
If i send the array direct in this way:
colorWipeAll(neoStrips, cWHITE, 100, 200);it is compiling but not working with arduino and the neopixel.
Adafruit_NeoPixel neoStrips[] = {
Adafruit_NeoPixel(NUM_NEO_PIXEL[0], NEOPIN[0], NEO_GRB + NEO_KHZ800),
Adafruit_NeoPixel(NUM_NEO_PIXEL[1], NEOPIN[1], NEO_GRB + NEO_KHZ800),
Adafruit_NeoPixel(NUM_NEO_PIXEL[2], NEOPIN[2], NEO_GRB + NEO_KHZ800),
Adafruit_NeoPixel(NUM_NEO_PIXEL[3], NEOPIN[3], NEO_GRB + NEO_KHZ800)
};
I can pass it to my function:
for(int i=0; i<NUMSTRIPS; i++)
colorWipe(&neoStrips[i], cGREEN, 10, 100);
void colorWipe(Adafruit_NeoPixel *strip, uint32_t c, uint8_t wait, int waiting) {
for(uint16_t i=0; i < strip->numPixels(); i++) {
strip->setPixelColor(i, c);
strip->show();
delay(wait);
}
delay(waiting);
}
which works fine!
But now i want to pass the whole NeoPixel Array like:
colorWipeAll(&neoStrips, cWHITE, 100, 200);
void colorWipeAll(Adafruit_NeoPixel *neoStrips[], uint32_t c, uint8_t wait, int waiting)
{
...
}
But this does not work.
I get only "not convert 'Adafruit_NeoPixel (*)[4]' to 'Adafruit_NeoPixel**".
I have tried also different other ways but found no solution till now.