thanks for shaking me loose...
#include "application.h"
#include "neopixel.h"
#define PIXEL_COUNT 150
Adafruit_NeoPixel myPixels = Adafruit_NeoPixel(PIXEL_COUNT, D2, WS2812B);
const uint8_t mySegment[] = {117,118,119,120}; //<<<<<<<correct, now
uint32_t arraySize = 0;
void setup()
{
Particle.variable("myArray", &arraySize, INT);
arraySize = sizeof(mySegment);
myPixels.begin();
myPixels.setBrightness(255);
myPixels.show();
}
void loop()
{
breatheUpdate(mySegment, 5, 1, 0);
}
void breatheUpdate(const uint8_t * segment, const uint32_t increment, const uint8_t step, const uint8_t lowLimit)
{
static uint32_t lastTimeChange = 0;
static uint8_t direction = 1;
static uint8_t value = lowLimit;
if(millis() - lastTimeChange > increment)
{
value += (direction * step);
if (value <= lowLimit || value >= 255)
{
direction = direction * -1;
}
for(uint8_t i = 0; i < sizeof(segment); i++)
{
myPixels.setPixelColor(segment[i], myPixels.Color(value, value, value));
}
myPixels.show();
lastTimeChange += increment;
}
}
the 'fixed' array length....
const uint8_t mySegment[8] = {10,11,12,13,14};
I didn't notice my error.
yeah, I just tossed that together to pull out the test... Well noted!