forked from calingeorgeadrian/ArduinoKTANE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuzzer.h
More file actions
63 lines (53 loc) · 1.08 KB
/
buzzer.h
File metadata and controls
63 lines (53 loc) · 1.08 KB
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
// The sounds for the buzzer
#define BUZZER 24
void victoryBuzzer() // the sound of the buzzer when the team wins
{
delay(700);
tone(BUZZER, 1000);
delay(250);
noTone(BUZZER);
delay(50);
tone(BUZZER, 600);
delay(250);
noTone(BUZZER);
delay(50);
tone(BUZZER, 1000);
delay(1000);
noTone(BUZZER);
}
void boomBuzzer() // the sound of the buzzer when the team loses
{
delay(700);
for (int i = 0; i < 4; i++) {
tone(BUZZER, 800);
delay(300);
noTone(BUZZER);
delay(100);
tone(BUZZER, 500);
delay(300);
noTone(BUZZER);
tone(BUZZER, 300);
delay(1000);
noTone(BUZZER);
}
}
void defusedModuleBuzzer() // the sound of the buzzer when a module is defused
{
tone(BUZZER, 500);
delay(300);
noTone(BUZZER);
delay(100);
tone(BUZZER, 1000);
delay(300);
noTone(BUZZER);
}
void strikeBuzzer() // the sound of the buzzer when the team makes a mistake
{
tone(BUZZER, 800);
delay(300);
noTone(BUZZER);
delay(100);
tone(BUZZER, 300);
delay(300);
noTone(BUZZER);
}