0% found this document useful (0 votes)
7 views1 page

Led Glow

Uploaded by

Pooja . G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Led Glow

Uploaded by

Pooja . G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

LED GLOW

#include <Adafruit_NeoPixel.h>
#define PIN 2 // Input pin Neopixel is attached to
#define NUMPIXELS 12 // Number of neopixels in Ring

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

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

You might also like