// For: https://forum.arduino.cc/t/how-to-turn-on-only-one-color-in-addressable-led-using-fastled-library/1014132
// A few changes were made, but the original sketch also turned the ledstrip green.
//
// Good tutorial: https://www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/
//
// Note that the first led is on the right in this simulation.
#include <FastLED.h>
#define NUM_LEDS 200
#define LED_PIN 2
CRGB leds[NUM_LEDS];
void setup()
{
Serial.begin(9600);
FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
FastLED.setBrightness(100); // not needed for Wokwi
}
void loop()
{
// Serial.println("Arduino for loop");
for (int i = 0; i < NUM_LEDS; i++)
{
leds[i] = CRGB::Green; // Predefined color of FastLED library
FastLED.show(); // Update the new data to the ledstrip
delay(10);
}
// Just green is no fun, let's add another color.
for (int i = NUM_LEDS -1; i >= 0; i--)
{
leds[i] = CRGB::Orange; // Predefined color of FastLED library
FastLED.show(); // Update the new data to the ledstrip
delay(10);
}
// Using the fill function
fill_solid(leds, NUM_LEDS, CRGB::Purple);
}