first commit
This commit is contained in:
27
LED_FASTLED_01/LED_FASTLED_01.ino
Executable file
27
LED_FASTLED_01/LED_FASTLED_01.ino
Executable file
@@ -0,0 +1,27 @@
|
||||
#include <FastLED.h>
|
||||
|
||||
#define LED_PIN 6
|
||||
#define NUM_LEDS 3
|
||||
|
||||
CRGB leds[NUM_LEDS];
|
||||
|
||||
void setup() {
|
||||
|
||||
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
for (int i = 0; i < NUM_LEDS; i++) {
|
||||
leds[i] = CRGB ( 0, 0, 255);
|
||||
FastLED.show();
|
||||
delay(100);
|
||||
}
|
||||
for (int i = NUM_LEDS; i > 0; i--) {
|
||||
leds[i] = CRGB ( 255, 0, 0);
|
||||
FastLED.show();
|
||||
delay(100);
|
||||
}
|
||||
Serial.println("Ici");
|
||||
}
|
||||
Reference in New Issue
Block a user