3

I'm in the process of trying to create a "Aurora Glow" effect using a Particle Photon and a Neopixel ring.

I have the code fully working using a single Breadboard-friendly NeoPixel however when upgrading this to a NeoPixel Ring (16 LED) the code does not run as expected

The current working code for a single NeoPixel can be found here: http://pastebin.com/Yj1cywpx

It was my assumption that i could change Line 33 from one LED to Sixteen e.g.:

FastLED.addLeds<NEOPIXEL, 6>(&led, 1);

to

FastLED.addLeds<NEOPIXEL, 6>(&led, 16);

However when I run this code rather than all NeoPixels cycling through the Aurora Colours, only the very Top LED does and rest are either off or a static colour (e.g. https://i.sstatic.net/6rY38.jpg)

Could someone please advise what i missing? Apologies if this is a "Noob" question but this is my 2nd Arduino project and I cannot understand why this would not work.

Thanks

4dogsofwar
  • 31
  • 2

2 Answers2

1

Never used neoPixels in arduino before so this is a complete guess based on reading the code but it looks like you are only setting the colour of the first LED.

Try creating 16 LED colours:

CRGB led[16];

and then setting them all:

for (int i = 0;i<15; i++) {
  int colourIndex = index + i;
  if (colourIndex > 15)
    colourIndex -= 15;
  led[i] = ColorFromPalette(auroraPalette, colourIndex , 255, LINEARBLEND);
}

edit - as @rDg indicates in his answer

FastLED.addLeds<NEOPIXEL, 6>(&led, 16);

becomes

FastLED.addLeds<NEOPIXEL, 6>(led, 16);

since led is now an array not a single value

Finally I think paletteSize should only be 16 not 5*16, you only have 16 colours in there.

Andrew
  • 1,060
  • 5
  • 8
0

In addition to the above, you need to tweak your addLeds line:

FastLED.addLeds<NEOPIXEL, 6>(led, 16);
rDg
  • 166
  • 2