#include <FastLED.h>
// Define the number of LEDs in each ring
#define LED_COUNT_1 1
#define LED_COUNT_8 8
#define LED_COUNT_12 12
#define LED_COUNT_16 16
// Define the digital I/O pins for the data lines
#define DATA_PIN_1 2
#define DATA_PIN_8 3
#define DATA_PIN_12 4
#define DATA_PIN_16 5
// Define the array of LEDs for each ring
CRGB leds_1[LED_COUNT_1];
CRGB leds_8[LED_COUNT_8];
CRGB leds_12[LED_COUNT_12];
CRGB leds_16[LED_COUNT_16];
// Speed adjustment (higher value = slower animation)
unsigned int speedAdjustment = 50; // Adjust this value to change the speed
void setup() {
FastLED.addLeds<WS2812B, DATA_PIN_1, GRB>(leds_1, LED_COUNT_1);
FastLED.addLeds<WS2812B, DATA_PIN_8, GRB>(leds_8, LED_COUNT_8);
FastLED.addLeds<WS2812B, DATA_PIN_12, GRB>(leds_12, LED_COUNT_12);
FastLED.addLeds<WS2812B, DATA_PIN_16, GRB>(leds_16, LED_COUNT_16);
// Set the first ring to bright yellow and show it
leds_1[0] = CRGB::Yellow; // Set to yellow color
FastLED.show();
}
void loop() {
// Run a different color fade sequence for the remaining rings
fadeColor(leds_8, LED_COUNT_8, 1); // Different phase for each ring
fadeColor(leds_12, LED_COUNT_12, 3);
fadeColor(leds_16, LED_COUNT_16, 4);
// Update the LEDs (excluding the first ring, which remains yellow)
FastLED.show();
// Small delay to control the speed of the animation
delay(10);
}
void fadeColor(CRGB* leds, int count, int phaseShift) {
uint8_t hue = (millis() / speedAdjustment + phaseShift * 100) % 256; // Phase shift each ring
for (int i = 0; i < count; i++) {
leds[i] = CHSV(hue, 50, 255);
}
}