Led Glow
Led Glow
#include <Adafruit_NeoPixel.h>
#define PIN 2 // Input pin Neopixel is attached to
#define NUMPIXELS 12 // Number of neopixels in Ring
int delayval=100;
// Define the color you want to glow
int redColor = 255; // Set red value (0-255)
int greenColor = 0; // Set green value (0-255)
int blueColor = 0; // Set blue value (0-255)
void setup() {
pixels.begin(); // Initializes the NeoPixel library.
pixels.clear(); // Clear all pixels at startup
pixels.show(); // Ensure the pixels are off initially
}
void loop() {
for (int i = 0; i < NUMPIXELS; i++) {
pixels.setPixelColor(i, pixels.Color(redColor, greenColor, blueColor)); // Set
the color for each pixel
}
pixels.show(); // Send the updated pixel color to the hardware
delay(delayval);
}