-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCalculateAQI.h
More file actions
37 lines (31 loc) · 755 Bytes
/
CalculateAQI.h
File metadata and controls
37 lines (31 loc) · 755 Bytes
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
#ifndef CalculateAQI_h
#define CalculateAQI_h
#include <stdint.h>
#include <PMS.h>
struct Breakpoints {
float iHi;
float iLo;
float cHi;
float cLo;
};
struct Category {
char* level;
char* color;
};
struct SensorData {
float PM_AE_UG_1_0;
float PM_AE_UG_2_5;
float PM_AE_UG_10_0;
float AQI;
int numReads;
};
class CalculateAQI {
public:
static void updateSensorData(SensorData &data, PMS::DATA newData, float AQI);
static SensorData getAveragedData(SensorData data);
static Category getCategory(float AQI);
static Breakpoints getPM25Breakpoints(float cPM25);
static float getPM25AQI(float cPM25);
static float getAQI(float I_high, float I_low, float C_high, float C_low, float C);
};
#endif