Complete rewrite of Application
This commit is contained in:
25
SensorManager.h
Normal file
25
SensorManager.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef SENSOR_MANAGER_H
|
||||
#define SENSOR_MANAGER_H
|
||||
|
||||
#include <AM2302-Sensor.h>
|
||||
|
||||
class SensorManager {
|
||||
private:
|
||||
AM2302::AM2302_Sensor sensor;
|
||||
float temperature;
|
||||
float humidity;
|
||||
|
||||
unsigned long lastRead;
|
||||
const unsigned long interval = 2000;
|
||||
|
||||
public:
|
||||
SensorManager(uint8_t pin);
|
||||
|
||||
void begin();
|
||||
void update(unsigned long now);
|
||||
|
||||
float getTemp() const;
|
||||
float getHumidity() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user