projectuser
2019-07-08 b2609ffef136a34774f23388b0371a50ca2a4286
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
/*
  ledShow.h - Library for 控制LED 
  Created by phoenix, 2019.07.02.
   
*/
 
#ifndef _LedShow_H_
#define _LedShow_H_ 
 
#include <Arduino.h>
#include <Wire.h>
 
/// led闪烁的时间间隔快慢
#define HOLDTIME_QUICKLY  200
#define HOLDTIME_NORMAL   1000
#define HOLDTIME_SLOW     2000
 
 
 
class LedShow
{
  public:
    LedShow(uint8_t inLedGpio=23); 
    void init();  
    void setOn();
    void setOff();
    void ledflashing(int  inCurtime, int holdTimeTag);
  private:
    uint8_t _LedGpio=10; 
    int pre_time=0;
    int led_state=HIGH;             //led初始状态为熄灭
 
};
 
#endif