-
Notifications
You must be signed in to change notification settings - Fork 12
/
StatusLED.h
47 lines (37 loc) · 1.06 KB
/
StatusLED.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
38
39
40
41
42
43
44
45
46
47
/*
* Copyright (c) 2012 Yeelink.net by dapingliu <[email protected]>
*/
#ifndef STATUSLED_H_
#define STATUSLED_H_
#include "Arduino.h"
#include "CommonData.h"
#include "MsTimer2.h"
class StatusLED {
private:
class CommonData *_cmdata;
unsigned int _local_flash_timer;
unsigned long _local_flash_start_time;
unsigned int _global_flash_timer;
unsigned long _global_flash_start_time;
public:
//pre-flash status, used to recover status after flash
ledStatus_t preFlashLocalLedStatus;
ledStatus_t preFlashGlobalLedStatus;
//Led status
ledStatus_t localLedStatus;
ledStatus_t globalLedStatus;
//functions
void begin(CommonData *cmdata);
void loop();
void setLocalOn();
void setLocalOff();
void setLocalFastFlash(unsigned int time); //ms, if time==0, always flash
void setLocalMiddleFlash(unsigned int time);
void setLocalSlowFlash(unsigned int time);
void setGlobalOn();
void setGlobalOff();
void setGlobalFastFlash(unsigned int time);
void setGlobalMiddleFlash(unsigned int time);
void setGlobalSlowFlash(unsigned int time);
};
#endif /* STATUSLED_H_ */