-
Notifications
You must be signed in to change notification settings - Fork 1
/
oculus_aethereum.ino
64 lines (42 loc) · 1.29 KB
/
oculus_aethereum.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
56
57
58
59
60
61
62
63
64
#include <Adafruit_NeoPixel.h>
#include "segment_models.h"
#include "segment_views.h"
#include "themes.h"
// Initialize
#define PIN 4
#define LED_COUNT 32
#define LEFT_EYE_START 0
#define RIGHT_EYE_START 16
#define LEDS_PER_EYE 16
#define THEME_SWITCH_DELAY 10000 // Milliseconds
Adafruit_NeoPixel led_strip = Adafruit_NeoPixel (LED_COUNT, PIN, NEO_GRB + NEO_KHZ800);
// Create containers for sections of your LED strands/circles.
StripView left_eye = StripView (led_strip, LEFT_EYE_START, LEDS_PER_EYE);
StripView right_eye = StripView (led_strip, RIGHT_EYE_START, LEDS_PER_EYE);
StripView both_eyes = StripView (led_strip, LEFT_EYE_START, LEDS_PER_EYE * 2);
void setup ()
{
// Aways give your project a safe boot delay so you can re-upload code when:
// - it uses too much current when your LEDs are too bright
// - the serial doesn't respond because of some timing issue
delay(3000);
led_strip.begin ();
}
// Main Loop
void loop ()
{
// Switch themes every {x} seconds
Theme::switch_every (THEME_SWITCH_DELAY);
left_eye.clear ();
right_eye.clear ();
both_eyes.clear ();
// Update the spots
left_eye.update ();
right_eye.update ();
both_eyes.update ();
// Draw the spots.
both_eyes.draw ();
left_eye.draw ();
right_eye.draw ();
led_strip.show ();
}