Lab_interaccio/2018/LLAC-RGBW-varios/FASTLED/FastLED-Lessons/examples/FastLED-03/FastLED-03.ino

47 lines
1,008 B
Arduino
Raw Normal View History

2025-02-25 21:29:42 +01:00
#include "FastLED.h"
// How many leds in your strip?
#define NUM_LEDS 10
#define BRIGHTNESS 32
// What data pin on the board are they connected to?
#define DATA_PIN 17
// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
FastLED.setBrightness(32);
}
void loop() {
// Turn the LEDs on, then pause
fill_solid(leds, NUM_LEDS, CRGB::Red);
FastLED.show();
delay(500);
// Now turn the LEDs off, then pause
fill_solid(leds, NUM_LEDS, CRGB::Black);
FastLED.show();
delay(500);
// Turn the LEDs on, then pause
fill_solid(leds, NUM_LEDS, CRGB::Green);
FastLED.show();
delay(500);
// Now turn the LEDs off, then pause
fill_solid(leds, NUM_LEDS, CRGB::Black);
FastLED.show();
delay(500);
// Turn the LEDs on, then pause
fill_solid(leds, NUM_LEDS, CRGB::Blue);
FastLED.show();
delay(500);
// Now turn the LEDs off, then pause
fill_solid(leds, NUM_LEDS, CRGB::Black);
FastLED.show();
delay(500);
}