-
Notifications
You must be signed in to change notification settings - Fork 24
/
ValentinesDay.cpp
49 lines (42 loc) · 1.07 KB
/
ValentinesDay.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <FastLED.h>
#define NUM_LEDS 50
#define DATA_PIN 6
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
}
void loop() {
// Set your Valentine's Day color scheme
CRGB red = CRGB(255, 0, 0);
CRGB pink = CRGB(255, 105, 180);
// Flashing effect
for (int i = 0; i < 5; i++) {
fill_solid(leds, NUM_LEDS, red);
FastLED.show();
delay(500);
fill_solid(leds, NUM_LEDS, CRGB::Black);
FastLED.show();
delay(500);
fill_solid(leds, NUM_LEDS, pink);
FastLED.show();
delay(500);
fill_solid(leds, NUM_LEDS, CRGB::Black);
FastLED.show();
delay(500);
}
// Heartbeat effect
for (int j = 0; j < 3; j++) {
for (int brightness = 0; brightness < 255; brightness++) {
fill_solid(leds, NUM_LEDS, pink);
FastLED.show();
FastLED.setBrightness(brightness);
delay(5);
}
for (int brightness = 255; brightness >= 0; brightness--) {
fill_solid(leds, NUM_LEDS, pink);
FastLED.show();
FastLED.setBrightness(brightness);
delay(5);
}
}
}