-
Notifications
You must be signed in to change notification settings - Fork 0
/
acthumi.h
51 lines (49 loc) · 812 Bytes
/
acthumi.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
48
49
50
51
#ifndef ACTHUMI_H
#define ACTHUMI_H
#include "actuator.h"
typedef enum
{
ACTHUMI_TURN_OFF,
ACTHUMI_HUMIDIFY,
ACTHUMI_DEHUMIDIFY
}
ACTHUMI_STATES;
class actHumi : public Actuator
{
public:
actHumi()
{
initGPIO();
}
virtual void setValue(uint32_t value)
{
switch(value)
{
case ACTHUMI_TURN_OFF:
//turn off
humidify(false);
dehumidify(false);
status.setVal(COLOR_WHITE);
break;
case ACTHUMI_HUMIDIFY:
//humidify
humidify(true);
status.setVal(COLOR_RED);
break;
case ACTHUMI_DEHUMIDIFY:
//dehumidify
dehumidify(true);
status.setVal(COLOR_BLUE);
break;
default:
//do nothing
break;
}
status.updateListeners();
}
protected:
static void initGPIO();
static void humidify(bool onOff);
static void dehumidify(bool onOff);
};
#endif // ACTHUMI_H