-
Notifications
You must be signed in to change notification settings - Fork 0
/
simon.ino
44 lines (34 loc) · 858 Bytes
/
simon.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
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#include "Speaker.h"
#include "Buttons.h"
#include "Game.h"
#define PIN_BUTTON_LEDS 12
Speaker speaker;
Adafruit_NeoPixel pixels(4, PIN_BUTTON_LEDS, NEO_GRB + NEO_KHZ800);
Buttons buttons(&speaker, &pixels);
DemoMode demoMode(&pixels, &buttons);
Game game(&buttons, &demoMode);
void setup() {
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
Serial.begin(115200);
#ifdef DEBUGGING
randomSeed(8483);
#else
// Not quality randomness but this isn't crypto.
randomSeed(analogRead(A5));
#endif
speaker.setup();
pixels.begin();
buttons.setup();
game.welcome();
while (true) {
speaker.tick();
game.tick();
}
}
void loop() {
}