-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlink.ino
50 lines (42 loc) · 902 Bytes
/
Blink.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>
//VARIABLES
const int MAX_LEVEL = 99;
int sequence[MAX_LEVEL];
int your_sequence[MAX_LEVEL];
int level = 1;
int score = 0;
int speedTimer = 2000; //milliseconds
bool lost = false;
//SETUP
void setup() {
// put your setup code here, to run once:
}
//LOOP
void loop() {
if(level == 1) {
generateSequence();
}
if(score<99 && lost==false) {
if(sequence[level] == 2) { //2 = horn
//hornCommand()
} else if (sequence[level] == 3) { //3 = signal
//signalCommand()
} else { //4 = turn
//turnCommand()
}
level++
score++
speedTimer-=10;
}
if(score == 99) {
//winSequence()
} else if (lost == true) {
//lostSequence()
}
}
void generateSequence() {
randomSeed(millis());
for(int i = 0; i<3; i++) {
sequence[i] = random(2, 5); // 2 = horn, 3 = signal, 4 = turn
}
}