-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSmartProbe.cpp
54 lines (41 loc) · 1.08 KB
/
SmartProbe.cpp
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
// SmartProbe - Object that stores unique info for each probe.
#include "SmartProbe.h"
SmartProbe::SmartProbe(uint8_t probePin, uint8_t ledPin, ThermistorProbe::ProbeType probeType, float alarmTemp, bool alarmEnable) {
_probePin = probePin;
_probeType = probeType;
_alarmTemp = alarmTemp;
_alarmEnable = alarmEnable;
_indicator = new SimpleLed(ledPin);
}
SmartProbe::~SmartProbe() {
if(_indicator) {
delete _indicator;
}
}
void SmartProbe::setProbeType(ThermistorProbe::ProbeType probeType) {
_probeType = probeType;
}
ThermistorProbe::ProbeType SmartProbe::getProbeType() {
return _probeType;
}
void SmartProbe::setAlarmTemp(float alarmTemp) {
_alarmTemp = alarmTemp;
}
float SmartProbe::getAlarmTemp() {
return _alarmTemp;
}
void SmartProbe::setAlarmEnable(bool alarmEnable) {
_alarmEnable = alarmEnable;
}
float SmartProbe::getAlarmEnable() {
return _alarmEnable;
}
void SmartProbe::activate() {
_indicator->on();
}
void SmartProbe::deactivate() {
_indicator->off();
}
uint8_t SmartProbe::getPin() {
return _probePin;
}