-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample3.ino
More file actions
45 lines (44 loc) · 1.31 KB
/
example3.ino
File metadata and controls
45 lines (44 loc) · 1.31 KB
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
/***************** NEEDED TO MAKE NODEMCU WORK ***************************/
#define FASTLED_INTERRUPT_RETRY_COUNT 0
#define FASTLED_ESP8266_RAW_PIN_ORDER
/****************** LIBRARY SECTION *************************************/
#include <FastLED.h>
/***************** LED LAYOUT AND SETUP *********************************/
#define NUM_LEDS 10
/***************** DECLARATIONS ****************************************/
CRGB leds[NUM_LEDS];
/***************** GLOBAL VARIABLES ************************************/
const int ledPin = 6;
/***************** SETUP FUNCTIONS ****************************************/
void setup()
{
Serial.begin(115200);
FastLED.addLeds<WS2812B, ledPin, RGB>(leds, NUM_LEDS);
}
/***************** MAIN LOOP ****************************************/
/** i dont even know what this is, looks like melting rainbow icecream**/
void loop()
{
leds[0] = CRGB(255, 0, 0);
FastLED.show();
delay(500);
leds[1] = CRGB(0, 255, 0);
FastLED.show();
delay(500);
leds[2] = CRGB(0, 0, 255);
FastLED.show();
delay(500);
leds[3] = CRGB(150, 0, 255);
FastLED.show();
delay(500);
leds[4] = CRGB(255, 200, 20);
FastLED.show();
delay(500);
leds[5] = CRGB(85, 60, 180);
FastLED.show();
delay(500);
leds[6] = CRGB(50, 255, 20);
FastLED.show();
delay(500);
FastLED.show();
}