-
Notifications
You must be signed in to change notification settings - Fork 0
/
stargate.ino
50 lines (43 loc) · 999 Bytes
/
stargate.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
#include <FastLED.h>
#include "gate.h"
#include "pulse.h"
gate g;
void setup() {
unsigned long t_start = millis();
while (!Serial && t_start - millis() < 1000);
//while (!Serial);
Serial.begin(115200);
Serial.println("resetting");
// Setup the WS2812B LED Rope
// Attach the SOL21 interrupt
g.setup();
// Briefly illuminate the visible portion and chevron positions
// Note: This will draw 1.2 A briefly
g.self_test();
}
void loop() {
if (g.is_triggered())
{
// TODO: use attract/gameplay to control if dialing will succeed or fail
// instead of checking if it's still triggered
g.dial();
if (g.is_triggered())
{
g.draw_event_horizon();
// TODO: Verify theoretical maximum 38 minute wormhole open
while (g.is_triggered()) {
g.draw_gate_open();
}
g.draw_collapsing_gate();
}
else
{
g.draw_event_horizon();
g.draw_collapsing_gate();
}
}
else
{
g.draw_gate_closed();
}
}