-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwater_torture_fled.ino
55 lines (43 loc) · 1.21 KB
/
water_torture_fled.ino
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
50
51
52
53
54
55
/**
* water_torture.ino
*
* Adapted for FastLED from Danny Havenith's code:
* https://github.com/DannyHavenith/ws2811
*
* @author Dougal Campbell <[email protected]>
* @link https://github.com/dougalcampbell
* @license BSL 1.0
*/
#include <FastLED.h>
// Data Out pin
#define DATA_PIN 3
// How many pixels are we driving? NOTE: Max 255 for Water_Torture
#define NUM_LEDS 60
CRGB leds[NUM_LEDS];
CLEDController *fled_ptr; // Pointer to FastLED instance
#include "water_torture.h"
Water_Torture droplet = Water_Torture();
// add a second droplet
Water_Torture droplet2 = Water_Torture();
void setup() {
fled_ptr = &(FastLED.addLeds<WS2811,DATA_PIN,GRB>(leds, NUM_LEDS));
FastLED.setBrightness(255);
droplet.setFastled(fled_ptr);
// Configure 2nd droplet
droplet2.setFastled(fled_ptr);
// Configurable color!
droplet2.setColor(CRGB::Orange);
// Configurable gravity!
droplet2.setGravity(4);
// Set the initial pause (milliseconds)
droplet2.droplet_pause = 750;
// Start from the far end of the strip, in case your
// setup runs from bottom to top:
droplet2.setReverse(true);
FastLED.clear();
}
void loop() {
droplet.animate();
droplet2.animate();
}
// - fin -