/*
Arduino | coding-help
help with LED animation
thebigm93 — 3/6/2025 5:06 PM
i have most of the code working but i want pin 7 and 8 to be doing
their animation at the smae time as 2,3,4 but for some reason pin 2
goes then pin 3 then 4 and so on i want everything to be going at
the same time.
DWW code below
*/
#include <FastLED.h>
#define LED_COUNT_RED 5
#define LED_COUNT_BLUE 5
#define LED_COUNT_GREEN 5 // 15
#define LED_COUNT_TEAL1 6
#define LED_COUNT_TEAL2 6 // 12
#define LED_COUNT_PULSE_LEFT 7
#define LED_COUNT_PULSE_RIGHT 7 // 14
int PULSE_LEFT_START = 0; // start (0)
int PULSE_LEFT_END = 6; // start plus number of leds in section (7)
// starting from zero
int PULSE_RIGHT_START = 7; // start last end plus 1 (7)
int PULSE_RIGHT_END = 13; // plus number of leds in sectionsection (7) inc start
int TEAL1_START = 14;
int TEAL1_END = 19;
int TEAL2_START = 20; // start last end plus 1
int TEAL2_END = 25; // plus number of leds in section
int BLUE_START = 26; // start last end plus 1
int BLUE_END = 30; // plus number of leds in section
int RED_START = 31;
int RED_END = 35;
int GREEN_START = 36;
int GREEN_END = 40;
int pulse_section_start = 0;
int pulse_section_stop = 13;
int fill_section_start = 14;
int fill_section_stop = 25;
int flash_section_start = 26;
int flash_section_stop = 40;
#define LED_COUNT 41 // zero to 40 = 41
#define LED_PIN_ALL 2
#define LED_PIN 2
#define NUM_LEDS 41
#define BRIGHTNESS 64
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
#define UPDATES_PER_SECOND 100
CRGB leds[NUM_LEDS];
#define LED_COUNT_RED 5
#define LED_COUNT_BLUE 5
#define LED_COUNT_GREEN 5 // 15
#define LED_COUNT_TEAL1 6
#define LED_COUNT_TEAL2 6 // 12
#define LED_COUNT_PULSE_LEFT 7
#define LED_COUNT_PULSE_RIGHT 7 // 14
bool lightsOn = true; // Lights will always be on
boolean flasherTriggered = 0; // Event triggered? [1=true, 0=false]
boolean pulsorTriggered = 0; // Event triggered? [1=true, 0=false]
int pulsor_speed = 500;
int flasher_speed = 1200;
void setup() {
FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
FastLED.clear();
}
void loop() {
if (lightsOn) {
// solid teals
fill_solid(leds + 14, 12, CRGB::Teal);
EVERY_N_MILLISECONDS(flasher_speed)
{
if (flasherTriggered )
{
fill_solid(leds + 26, 5, CRGB::Green);
fill_solid(leds + 36, 5, CRGB::Blue);
fill_solid(leds + 31, 5, CRGB::Red);
flasherTriggered = 0;
FastLED.show();
}
else
{
fill_solid(leds + 26, 5, CRGB::Black);
fill_solid(leds + 36, 5, CRGB::Black);
fill_solid(leds + 31, 5, CRGB::Black);
flasherTriggered = 1;
FastLED.show();
}
}
EVERY_N_MILLISECONDS(pulsor_speed)
{
if (pulsorTriggered )
{
fill_solid(leds, 7, CRGB::Teal);
fill_solid(leds + 7, 7, CRGB::Teal);
pulsorTriggered = 0;
FastLED.show();
}
else
{
fill_solid(leds, 7, CRGB::Black);
fill_solid(leds + 7, 7, CRGB::Black);
pulsorTriggered = 1;
FastLED.show();
}
}
}
else
{
FastLED.clear();
FastLED.show();
}
}
FLASH
BLUE 5
FLASH
Green 5
FLASH
RED 5
SOLID
TEAL1 6
SOLID
TEAL 2 6
Pulse
Left 7
Pulse
RIGHT 7