Back to Parent

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

// 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);

uint8_t i = 0;

unsigned long lastFade = 0;

void setup() {
    
    strip.begin();
    uint32_t c = strip.Color(0, 0, 0); // white
    for( uint16_t a = 0; a < strip.numPixels(); a++ ){
        strip.setPixelColor(a, c); // set white
    }
    
    
}



void loop() {
    
    
    unsigned long now = millis();
    
    if((now-lastFade)<=15 * 60 * 1000)
    {
        i+1;
        uint32_t c = strip.Color(i, 0, 0);
        
        for( uint16_t x = 0; x < strip.numPixels(); x++ ){
        strip.setPixelColor(x, c);
        }
        
        delay(3600);
    }
    
    else if((now-lastFade)>15 * 60 * 1000){
        i-1;
        uint32_t c = strip.Color(i, 0, 0);
        for( uint16_t x = 0; x < strip.numPixels(); x++ ){
        strip.setPixelColor(x, c);
        }
        
        delay(3600);
    }
    
    

}
Click to Expand

Content Rating

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

0