-
Notifications
You must be signed in to change notification settings - Fork 0
/
IO_fnc.ino
59 lines (51 loc) · 1.17 KB
/
IO_fnc.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
57
58
59
//fonction d'accesibilité pour les IO
void ledOff() {
digitalWrite(GREEN, HIGH);
digitalWrite(ORANGE, HIGH);
digitalWrite(RED, HIGH);
}
void ledGreen() {
digitalWrite(GREEN, LOW);
digitalWrite(ORANGE, HIGH);
digitalWrite(RED, HIGH);
}
void ledOrange() {
digitalWrite(GREEN, HIGH);
digitalWrite(ORANGE, LOW);
digitalWrite(RED, HIGH);
}
void ledRed() {
digitalWrite(GREEN, HIGH);
digitalWrite(ORANGE, HIGH);
digitalWrite(RED, LOW);
}
//on declanche la sortie <!> ca fait du bruit a 490Hz
void beep(boolean start) {
//on ne beep que la la config est activé (bit 1 pour le start, 2 pour le end)
if ((start && startSnd) || (!start && stopSnd)) {
analogWrite(BZ_PIN, configPwm);
delay(1000);
analogWrite(BZ_PIN, 0);
}
else
delay(1000);
}
void beepTest() {
analogWrite(BZ_PIN, configPwm);
delay(100);
analogWrite(BZ_PIN, 0);
}
void consumeBtEvent() {
btEvent = NO_EVENT;
}
void updateSndConfig() {
int snd = startSnd;
if (stopSnd)
snd += 2;
EEPROM.update(SND_STATU_ADDR, snd);
EEPROM.update(PWM_RATIO_ADDR, configPwm);
}
void updateTempoConfig() {
EEPROM.update(TIMER1_ADDR, temps_P1);
EEPROM.update(TIMER2_ADDR, temps_P2);
}