Back to Parent

// This #include statement was automatically added by the Particle IDE.
#include <neopixel.h>

// IMPORTANT: Set pixel COUNT, PIN and TYPE
#define PIXEL_PIN D2
#define PIXEL_COUNT 16
#define PIXEL_TYPE WS2812
 
Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);

void setup() {
    
    strip.begin();
    strip.show();
}

void loop() {

                // Add This Part back if you want to make it rotate changing colors 
 
//     for( int i = 0; i < strip.numPixels(); i++ ){
//      strip.setPixelColor(i, 255, 40, 40 ); // set a color 
//     strip.show();
//     delay( 10 );
// }
//       for( int i = 0; i < strip.numPixels(); i++ ){
//      strip.setPixelColor(i, 70, 70, 255 ); // set a color 
      
//     strip.show();
//     delay( 10 );
//       }

                 // This makes it go brighter and then dim back down

    for( int k = 0; k <256; k++ ){
        for( int i = 0; i < strip.numPixels(); i++ ){
            strip.setPixelColor(i, k / 2, 0, k ); // set a color 
        }
    strip.show();
    delay( 10 );
}
    for( int k = 255; k >=0; k-- ){
      for( int i = 0; i < strip.numPixels(); i++ ){
      strip.setPixelColor(i, k / 2, 0, k ); // set a color
      }
    strip.show();
    delay( 10 );
      }
}
Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0