NeoPixel Lights

I'm trying to get my neo pixel strip to turn on and then flicker but so far I've only gotten it to turn on and then it loops, I'm not sure what to do and I also want to set a push buttons for the lights too but so far they don't do what I want. here is my code any help would be great.

// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// Released under the GPLv3 license to match the rest of the
// Adafruit NeoPixel library

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
 #include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif

// Which pin on the Arduino is connected to the NeoPixels?
#define PIN        2 // On Trinket or Gemma, suggest changing this to 1

// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 60 // Popular NeoPixel ring size

// When setting up the NeoPixel library, we tell it how many pixels,
// and which pin to use to send signals. Note that for older NeoPixel
// strips you might need to change the third parameter -- see the
// strandtest example for more information on possible values.
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

#define DELAYVAL 50 // Time (in milliseconds) to pause between pixels

void setup() {
  // These lines are specifically to support the Adafruit Trinket 5V 16 MHz.
  // Any other board, you can remove this part (but no harm leaving it):
#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
  clock_prescale_set(clock_div_1);
#endif
  // END of Trinket-specific code.

  pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
}

void loop() {
  pixels.clear(); // Set all pixel colors to 'off'

  // The first NeoPixel in a strand is #0, second is 1, all the way up
  // to the count of pixels minus one.
  for(int i=0; i<NUMPIXELS; i++) { // For each pixel...

    // pixels.Color() takes RGB values, from 0,0,0 up to 255,255,255
    // Here we're using a moderately bright green color:
    pixels.setPixelColor(i, pixels.Color(0, 45, 255));

    pixels.show();   // Send the updated pixel colors to the hardware.

    delay(DELAYVAL); // Pause before next pass through loop
  }
  
}

Please read the how to get the best from the forum posts.

Format your code using the IDE autoformat tool.

Post the code in a code block using code tags.

Following the rules will get you help faster.

I couldn't find anything in the forums for the best bet so I could still use some help I'm still new to all this. I'm using the code that came from Adafruit so I'm not sure how much I can change it.

i see what you mean now and I was able to fix one of the problems

The link for how to get the best from the forum.

The trick is.. Don't learn to CODE, teach the processor HUMAN. Specifically YOUR version of human.

What I would do?

You want them to all turn on..
Then you want them to flicker. (IE on/off fast?)
Well, you can do all of this easy by creating a function...

void turnLEDs(bool onOff) {

   if (onOff) {
      for(int i=0; i<NUMPIXELS; i++) { // For each pixel...
         pixels.setPixelColor(i, pixels.Color(0, 45, 255));
      }
   } else {
      pixels.clear(); // Set all pixel colors to 'off'
   }
   pixels.show(); // show the result.
}

Now in loop() you have a function you can use to turn them on or off and space it out by.. (gasp) delay(). Make it flicker-ish.

Duplicate topics.