-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuzzer_functions.ino
56 lines (45 loc) · 1.07 KB
/
buzzer_functions.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
51
52
53
54
55
56
const int BUZZER_PIN = 11;
const int FREQ_POWER_ERROR = 4000;
const int FREQ_MAX_TEMPERATURE = 100;
const int FREQ_MIN_TEMPERATURE = 7000;
const int FREQ_NO_TEMPERATURE_SENSOR = 1000;
const int FREQ_START_WORK = 2000;
const int FREQ_CAMERA_RESET = 3000;
const int FREQ_SIGNAL_WORK_START = 500;
const int FREQ_SIGNAL_WORK_STOP = 300;
void buzzSignalStop(){
noTone(BUZZER_PIN);
pinMode(BUZZER_PIN, INPUT);
}
void buzzPowerError(){
buzzSignalStop();
tone(BUZZER_PIN, FREQ_POWER_ERROR);
}
void buzzNoTempSensor(){
buzzSignalStop();
tone(BUZZER_PIN, FREQ_NO_TEMPERATURE_SENSOR);
}
void buzzMaxTemp(){
buzzSignalStop();
tone(BUZZER_PIN, FREQ_MAX_TEMPERATURE);
}
void buzzMinTemp(){
buzzSignalStop();
tone(BUZZER_PIN, FREQ_MIN_TEMPERATURE);
}
void buzzStartWork(){
buzzSignalStop();
tone(BUZZER_PIN, FREQ_START_WORK);
}
void buzzCameraReset(){
buzzSignalStop();
tone(BUZZER_PIN, FREQ_CAMERA_RESET);
}
void buzzSignalStart(){
buzzSignalStop();
tone(BUZZER_PIN, FREQ_SIGNAL_WORK_START);
}
void buzzSignalStop(){
buzzSignalStop();
tone(BUZZER_PIN, FREQ_SIGNAL_WORK_STOP);
}