-
Notifications
You must be signed in to change notification settings - Fork 1
/
HumiditySensor.h
68 lines (50 loc) · 1.4 KB
/
HumiditySensor.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* Copyright (C) 2015 Willi Menapace <[email protected]>, Simone Lorengo <[email protected]> - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited
* Proprietary and confidential
* Written by Simone Lorengo <[email protected]>
*/
#ifndef HUMIDITY_SENSOR_INCLUDED
#define HUMIDITY_SENSOR_INCLUDED
#include "GlobalDefines.h"
#ifdef ONBOARD
#include "GroundHumidity.cpp"
#include "Sensor.h"
/**
* Rappresenta un sensore di umidità del terreno analogico
* Modello di riferimento: Moisture Sensor
*/
class HumiditySensor : public Sensor {
private:
SensorType type;
int sensorPin;
long offset;
/**
* @return valore non elaborato
*/
long getRaw();
public:
SensorType getType();
/**
* @return valore elaborato del sensore
*/
long readValue();
/**
* @return valore del sensore con enumeratore GroundHumidity;
*/
GroundHumidity readRange();
/**
* Verifica che il sensore sia collegato basandosi sui valori letti. Non completamente affidabile e genera un blocco di circa 2 secondi
* @return corretto funzionamento sensore
*/
bool check();
/**
* Imposta un offset per la calibrazione del sensore
*/
void setOffset(long calibOffset);
/**
* Crea un sensore di tipo HUMIDITY
*/
HumiditySensor(int sensorAnalogPin);
};
#endif //ONBOARD
#endif // HUMIDITY_SENSOR_INCLUDED