/***************************************************************
To arduino uno attached neopixel ring via pin 6 with
12 led write a code in such a way that first led blinkd once
second twicce third trice and so on with random color
This code uses the Adafruit_NeoPixel library to control the
NeoPixel ring. It sets the color of each LED to a random RGB
value, and then blinks the LED i+1 times (e.g., the first LED
blinks once, the second LED blinks twice, etc.) using a loop.
The delay() function is used to control the duration of
each blink.
AUTHOR ARVIND PATIL 12 MAY 2023
****************************************************************/
#include <Adafruit_NeoPixel.h>
#define LED_PIN 6
#define LED_COUNT 12
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
Serial.begin(9600); // Initialize Serial communication
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
void loop() {
for (int i = 0; i < LED_COUNT; i++) {
Serial.print("Blink ");
Serial.print(i+1);
Serial.println(" times");
for (int j = 0; j < i+1; j++) {
strip.setPixelColor(i, random(256), random(256), random(256));
strip.show();
delay(100);
}
delay(500);
}
}