mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-01 10:40:57 +02:00
[fix] build fail on example BASIC
This commit is contained in:
@ -57,13 +57,16 @@ CC BY-SA 4.0 Attribution-ShareAlike 4.0 International License
|
||||
static AirGradient ag = AirGradient(DIY_BASIC);
|
||||
static Configuration configuration(Serial);
|
||||
static AgApiClient apiClient(Serial, configuration);
|
||||
static WifiConnector wifiConnector(Serial);
|
||||
|
||||
static Measurements measurements;
|
||||
static OledDisplay oledDisp(configuration, measurements, Serial);
|
||||
static StateMachine sm(oledDisp, Serial, measurements, configuration);
|
||||
static WifiConnector wifiConnector(oledDisp, Serial, sm, configuration);
|
||||
|
||||
static int co2Ppm = -1;
|
||||
static int pm25 = -1;
|
||||
static float temp = -1001;
|
||||
static int hum = -1;
|
||||
static long val;
|
||||
|
||||
static void boardInit(void);
|
||||
static void failedHandler(String msg);
|
||||
|
@ -204,7 +204,7 @@ void loop() {
|
||||
if (configuration.hasSensorS8) {
|
||||
co2Schedule.run();
|
||||
}
|
||||
if (configuration.hasSensorPMS) {
|
||||
if (configuration.hasSensorPMS1) {
|
||||
pmsSchedule.run();
|
||||
ag.pms5003.handle();
|
||||
}
|
||||
@ -546,11 +546,11 @@ static void boardInit(void) {
|
||||
}
|
||||
|
||||
/** Init PMS5003 */
|
||||
configuration.hasSensorPMS1 = false;
|
||||
configuration.hasSensorPMS1 = true;
|
||||
configuration.hasSensorPMS2 = false;
|
||||
if (ag.pms5003.begin(&Serial) == false) {
|
||||
Serial.println("PMS sensor not found");
|
||||
configuration.hasSensorPMS = false;
|
||||
configuration.hasSensorPMS1 = false;
|
||||
|
||||
dispSensorNotFound("PMS");
|
||||
}
|
||||
|
@ -81,14 +81,14 @@ String OpenMetrics::getPayload(void) {
|
||||
ahumCompensated = _hum;
|
||||
}
|
||||
|
||||
if (config.hasSensorPMS) {
|
||||
if (config.hasSensorPMS1) {
|
||||
pm01 = measure.pm01_1;
|
||||
pm25 = measure.pm25_1;
|
||||
pm10 = measure.pm10_1;
|
||||
pm03PCount = measure.pm03PCount_1;
|
||||
}
|
||||
|
||||
if (config.hasSensorPMS) {
|
||||
if (config.hasSensorPMS1) {
|
||||
if (pm01 >= 0) {
|
||||
add_metric("pm1",
|
||||
"PM1.0 concentration as measured by the AirGradient PMS "
|
||||
|
Reference in New Issue
Block a user