- Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_NeoPixel.h>
#define PIN 9 //Which pin the pixels are connected to
#define LED_COUNT 6 //Number of pixels used
// Create an instance of the Adafruit_NeoPixel class called "leds".
// That'll be what we refer to from here on...
Adafruit_NeoPixel leds = Adafruit_NeoPixel(LED_COUNT, PIN, NEO_GRB + NEO_KHZ800);
void setup()
{
leds.begin(); // Start up the LED strip
leds.show(); // LEDs don't actually update until you call this function
}
void loop()
{
leds.setPixelColor(0, 255, 0, 0); // Set the running light top right
leds.setPixelColor(1, 255, 0, 0); // Set the running light bottom right
leds.setPixelColor(2, 255, 0, 255); // Set the center eye right
leds.setPixelColor(3, 255, 0, 255); // Set the center eye left
leds.setPixelColor(4, 255, 0, 0); // Set the running light bottom left
leds.setPixelColor(5, 255, 0, 0); // Set the running light top left
leds.show(); //Display the colors
}
setpixelcolor(2
setpixelcolor(3
are the codes I'm looking to fade without altering the others.