Can some one please Help with addressable LED sketch I need?

Can some one please Help with addressable LED sketch I need?
I have tried your sketch and only the first 9 out of 16 led’s light up.
I would like to make the led’s start at 0 and go to 16 and start over again in the color white, I know it is probably no big deal for some one that knows how to do this but its my first time using addressable LED’s and making sketch’s.

The data pin I’am using is #3 and my board is Mini Nano V3.0 ATmega328P 5V 16M Micro Controller Board Module Arduino.

Can you share your code? Please put it on http://gist.github.com and share the link.

I have not found a code yet that does this that’s why I was asking if anybody knew where I could get one to try or modify. Thanks

@Anx_Xna Well, you did say "I have tried your sketch . . . ". We don’t know who “you” is and Marc was wondering what sketch you tried.

In the meantime, I made this for my test APA102 based test strand:

@Anx_Xna It might be good to see the sketch you’re using to try to understand what’s happening, otherwise we might be completely guessing.

And here’s a sketch that might give you some ideas to explore.

Thank you I will try this when I get home tonight. It was the Larson scanner sketch on Adafruit site.

Doing some more sleuthing. . . The Larson scanner Sketch that I found at:

is not the same as the video you showed us. The Larson scanner sketch goes back and forth (we call that Cylon), while the video goes round and round.

These are two different things.

In addition to the ‘round and round’ sketch I provided, FastLED comes with a cylon sketch:

You guys are awesome thank you very much I can’t wait to try these when I get home at 5 p.m.

@Anx_Xna Do keep in mind that we’re using the FastLED display library as found at:

We don’t use the NeoPixel library from Adafruit, although FastLED DOES support NeoPixels and most of the folks here use those.

I will change it to github version.

@Anx_Xna - You might want to look at my sketch at:

with a video of this sketch at:

Modifying this sketch using the color white and using the cd77_police_lights_one function should allow you to do what you are trying to accomplish.

@Ken_White
Thank you, I will try this one after work.

Error compiling for board Arduino Nano. for Police lights.

@Anx_Xna - I just complied it on a Uno and it compiles correctly. I do not have a Nano handy but if it compiles on an Uno then it will compile on a Nano. Did you download the four files in:

and put them in the same folder?

@Anx_Xna Please share more info to make it easier to help out. What is the error message??

Other info that might be useful to share would be the version of the Arduino IDE are you using and the version of FastLED you have?

ohh no I just copied the code…

This code is close to what I need, if I can figure out how to make only 2 lights go round and round.
#include <FastLED.h>

#define NUM_LEDS 9
#define DATA_PIN 3

int FrameDelay = 40;

int colorBarPosition = 1;
int frameCounter = 0;

//list of colors these are RGB hex colors
long colorPallet[] = {

CRGB::White,

};

// calculate number of colors in the array, needed later
int numberofColors=(sizeof(colorPallet)/sizeof(colorPallet[0]));
// calculate color bar length based on number of leds
int colorBarLength = (NUM_LEDS/numberofColors)*1;
int palletPosition = 0;
bool clearLEDS = false;

// setup LED array
CRGBArray<NUM_LEDS> leds;

void setup()
{
delay(9000);
// sanity delay for recovery if needed
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
FastLED.clear();
FastLED.setBrightness (50);
FastLED.show();
}

void loop()
{
EVERY_N_MILLISECONDS(FrameDelay)
{
// loop to shift LED values lower the array
for (int x=0; x<NUM_LEDS-1; x++)
{
leds[x] = leds[x+1];
}

// set last LED to the correct color based on color bar position and color bar length
if ((colorBarPosition <= colorBarLength) && !clearLEDS)
{
  leds[NUM_LEDS-1] = colorPallet[palletPosition];
  colorBarPosition++;
}

// check pallet position and bar position if at the end of both, start clear process
if ((palletPosition == numberofColors-1) && (colorBarPosition > colorBarLength) && !clearLEDS)
{
  //set last LED to black(0x000000)
  leds[NUM_LEDS-1]=CRGB::Black;
  // reset variables to start for bar positions
  palletPosition = 0;
  colorBarPosition = 1;
  //set clear LEDS flag to complete clearing
  clearLEDS= true;
  
}
if ((colorBarPosition > colorBarLength) && !clearLEDS)
{
  // reset bar position and step to next color
  colorBarPosition = 1;
  palletPosition = palletPosition+1;
}
// check if clearing process is complete, if so clear flag
if (clearLEDS && !leds(0,NUM_LEDS-1))
{
  clearLEDS = false;
}

}

FastLED.show ();

}
it will work, but I will put the police one in 1 folder and try it, how do I get it to see the folder.

Here is a video of what I have going from this code I just posted
missing/deleted image from Google+

Do I have to change the Fastled to the Adafruit one to make it work?
and which Sketch do I use?

@Anx_Xna - I have just posted a new sketch in GitHub Gist that contains only the function, cd77_police_lights_one_modified, from my original sketch, CD77_Police_Lights. It is located at:

Change the variables in line 38 to get the effects that you want.