Files
drybox/SensorManager.h

25 lines
402 B
C++

#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