-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path_alarm.h
40 lines (32 loc) · 823 Bytes
/
_alarm.h
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
#include <SimpleTimer.h>
extern SimpleTimer timer;
extern WS2812FX *ws2812fx;
void ringAlarm(int h, int m, String ampm ) {
if (alarmOn == true)
{
if (ampm == "PM")
{
h = h + 12;
}
if (alarmHours == h && alarmMinutes == m && alarmIsRunning == false)
{
Blynk.virtualWrite(FX_BUTTON_WIDGET, HIGH);
ws2812fx->setMode(1);
ws2812fx->setBrightness(255);
ws2812fx->setSpeed(255);
timer.disable(Timer[MSG_TIMER]);
Blynk.virtualWrite(TEXT_SCROLL_BUTTON_WIDGET, LOW);
Blynk.virtualWrite(SHOW_TIME_BUTTON_WIDGET, LOW);
timer.enable(Timer[ALARM_TIMER]);
timer.enable(Timer[FX_TIMER]);
Blynk.notify("Wake UP!!!!");
alarmIsRunning = true;
}
}
}
void ringTimer()
{
tone(BUZZER_PIN, 4400);
delay(100);
noTone(BUZZER_PIN);
}