Added AM2302 sensor reading to one of the screens

This commit is contained in:
2026-06-22 18:43:20 +03:00
parent be6670b982
commit 5e88eee23b
7 changed files with 120 additions and 6 deletions
+28
View File
@@ -0,0 +1,28 @@
#ifndef AM2302_SENSOR_H
#define AM2302_SENSOR_H
#include <Arduino.h>
struct Am2302Reading
{
float temperatureC;
float humidityPercent;
bool valid;
};
class Am2302Sensor
{
public:
explicit Am2302Sensor(uint8_t pin);
void begin();
bool update(unsigned long now);
Am2302Reading reading() const;
private:
uint8_t pin_;
unsigned long nextRead_;
Am2302Reading reading_;
};
#endif