need to use it to set the brightness of your LED(s). Try making all three flicker with the same brightness. Play with the updateSize to create different effects. Try making all three flicker independently (they will each have a separate "oldValue" and call randWalk() separately.)
This is the code that needs to be modified
#include "Particle.h"
#include "neopixel.h"
// These lines of code should appear AFTER the #include statements, and before
// the setup() function.
// IMPORTANT: Set pixel COUNT, PIN and TYPE
int PIXEL_PIN = D4;
int PIXEL_COUNT = 3;
int PIXEL_TYPE = WS2812;
int randWalk (int oldValue, int updateSize)
// int PIXEL_TYPE = WS2812;
// WS2812 NOTE: use WS2812 if you have them
Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);
void setup() {
strip.begin();
}
void loop() {
/* NOTE: Two versions of the color code are specified below for WS2811 and
WS2812 neopixels. Use the version according to the type of neopixels in
your kit and delete or comment the other version. */
//Setup some colors, WS2811 version
int PixelColorRed = strip.Color( 0, 50, 0);
int PixelColorGreen = strip.Color( 50 , 0, 0);
int PixelColorBlue = strip.Color( 0 , 0, 50);
//Setup some colors, WS2812 version
//Sets the color
strip.setPixelColor(0, PixelColorRed);
strip.setPixelColor(1, PixelColorGreen);
strip.setPixelColor(2, PixelColorBlue);
strip.show();
delay(1000);
//sets brightness to 100
PixelColorRed = strip.Color( 0, 100, 0);
PixelColorGreen = strip.Color( 100 , 0, 0);
PixelColorBlue = strip.Color( 0 , 0, 100);
strip.setPixelColor(0, PixelColorRed);
strip.setPixelColor(1, PixelColorGreen);
strip.setPixelColor(2, PixelColorBlue);
strip.show();
delay(1000);
//set brightness to 150
PixelColorRed = strip.Color( 0, 150, 0);
PixelColorGreen = strip.Color( 150 , 0, 0);
PixelColorBlue = strip.Color( 0 , 0, 150);
strip.setPixelColor(0, PixelColorRed);
strip.setPixelColor(1, PixelColorGreen);
strip.setPixelColor(2, PixelColorBlue);
strip.show();
delay(1000);
//set brightness to 200
PixelColorRed = strip.Color( 0, 200, 0);
PixelColorGreen = strip.Color( 200 , 0, 0);
PixelColorBlue = strip.Color( 0 , 0, 200);
strip.setPixelColor(0, PixelColorRed);
strip.setPixelColor(1, PixelColorGreen);
strip.setPixelColor(2, PixelColorBlue);
strip.show();
delay(1000);
//set brightness to 255
PixelColorRed = strip.Color( 0, 255, 0);
PixelColorGreen = strip.Color( 255, 0, 0);
PixelColorRed = strip.Color( 0, 0, 255);
strip.show();
delay (1000);