-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlight_arduino.ino
More file actions
64 lines (49 loc) · 1.61 KB
/
light_arduino.ino
File metadata and controls
64 lines (49 loc) · 1.61 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <FastLED.h>
#include <PacketSerial.h>
#define LED_TYPE NEOPIXEL
#define COLOR_ORDER RGB
#define framerate 500
//#define COLOR_CORRECTION CRGB(255,172,240)
#define BRIGHTNESS 125
#define NUM_STRIPS 5
#define NUM_LEDS_PER_STRIP 240
#define NUM_LEDS 1118
CRGB leds[NUM_LEDS];
#include "ledarray.h"
#include "animation.h"
#include "noise.h"
#define NUM_ANIMATIONS 1
Animation * current_animation;
Animation *(*list[NUM_ANIMATIONS])(LEDArray * ledarray);
LEDArray *ledarray;
void setup() {
// power-up sanity delay
pinMode(12, INPUT);
//delay( 3000 );
// tell FastLED about the LEDs
FastLED.addLeds<NEOPIXEL, 2>(leds, 0*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
FastLED.addLeds<NEOPIXEL, 3>(leds, 1*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
FastLED.addLeds<NEOPIXEL, 6>(leds, 2*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
FastLED.addLeds<NEOPIXEL, 4>(leds, 3*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
FastLED.addLeds<NEOPIXEL, 5>(leds, 4*NUM_LEDS_PER_STRIP, 158);
//FastLED.addLeds<NEOPIXEL, 4>(leds, 0*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
// set master brightness control
FastLED.setBrightness(BRIGHTNESS);
//fill_solid(leds,NUM_LEDS,CHSV(128,255,128));
FastLED.show();
ledarray=new LEDArray(leds,NUM_LEDS);
list[0] = &noise_factory;
//list[1] = &foobar_factory;
current_animation = list[0](ledarray);
}
// loop is called repeatedly forever
void loop()
{
current_animation->step(ledarray);
/*if(digitalRead(12)==HIGH){
fill_solid(leds,NUM_LEDS,CHSV(64,255,128));
} else {
fill_solid(leds,NUM_LEDS,CHSV(192,255,128));
}
FastLED.show(); */
}