-
Notifications
You must be signed in to change notification settings - Fork 2
/
SensorManager.h
41 lines (37 loc) · 1.19 KB
/
SensorManager.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
#ifndef SensorManager_h
#define SensorManager_h
#include <DHT.h>
#include "Application.h"
#include "DomoticzBroadcaster.h"
class SensorManager
{
private:
Application *lconfig;
DomoticzBroadcaster * ldomo;
// Initialisation du capteur de température DHT
DHT *dht;
unsigned long previousMillis = 0; // Stockage de l'heure la dernière lecture du capteur de température / humidité
// const long interval = 2000; // Delai entre deux requêtes de lecture du capteur de température / humidité
unsigned long previousMillisPIR=0; // Temps de la dernière lecture du capteur de présence
uint8_t inputStatePIR=0;
unsigned long presencefirst=0;
unsigned long presencelast=0;
unsigned int presencecount=0;
float Temp=-1.0;
float Hum=-1.0;
public:
SensorManager(Application *c, DomoticzBroadcaster * domo);
SensorManager();
void init();
void ReadTempHum();
float getDirectTemp();
float getDirectHum();
void readPir(uint8_t prestime);
uint8 getStatePIR();
long getPirlast() {return presencelast;};
long getPirfirst() {return presencefirst;};
unsigned int getPircount() {return presencecount;};
float getTemp() {return Temp;};
float getHum() {return Hum;};
};
#endif