-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReactionTime.ino
44 lines (37 loc) · 983 Bytes
/
ReactionTime.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
/*
---------------------------------------------
Reaction time game.
See: https://github.com/hyankov/reaction_time
---------------------------------------------
*/
// 1st party includes
#include "Pins.hh" // Pin layout. Set pins according to your wiring
#include "Settings.hh" // Include settings
#include "Sonar.hh" // Sonar handling
#include "Display.hh" // Display handling
#include "Lights.hh" // Lights handling
#include "Gameplay.hh" // Gameplay handling
#include "World.hh" // The world
// Setup and initialize
void setup()
{
// Random seed
randomSeed(analogRead(PIN_UNUSED_ANALOG));
// Setup the sonar
setupSonar();
// Setup the gameplay
setupGameplay();
// Setup the display
setupDisplay();
// Setup the lights
setupLights();
}
// The main loop, repeating over and over again
void loop()
{
world.now = millis();
loopSonar();
loopGameplay();
loopDisplay();
loopLights();
}