mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-16 10:12:09 +02:00
update API change on example
This commit is contained in:
@ -503,7 +503,7 @@ static void updateTvoc(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void updatePm(void) {
|
static void updatePm(void) {
|
||||||
if (ag.pms5003.isFailed() == false) {
|
if (ag.pms5003.connected()) {
|
||||||
measurements.pm01_1 = ag.pms5003.getPm01Ae();
|
measurements.pm01_1 = ag.pms5003.getPm01Ae();
|
||||||
measurements.pm25_1 = ag.pms5003.getPm25Ae();
|
measurements.pm25_1 = ag.pms5003.getPm25Ae();
|
||||||
measurements.pm10_1 = ag.pms5003.getPm10Ae();
|
measurements.pm10_1 = ag.pms5003.getPm10Ae();
|
||||||
|
@ -555,7 +555,7 @@ static void updateTvoc(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void updatePm(void) {
|
static void updatePm(void) {
|
||||||
if (ag.pms5003.isFailed() == false) {
|
if (ag.pms5003.connected()) {
|
||||||
measurements.pm01_1 = ag.pms5003.getPm01Ae();
|
measurements.pm01_1 = ag.pms5003.getPm01Ae();
|
||||||
measurements.pm25_1 = ag.pms5003.getPm25Ae();
|
measurements.pm25_1 = ag.pms5003.getPm25Ae();
|
||||||
measurements.pm10_1 = ag.pms5003.getPm10Ae();
|
measurements.pm10_1 = ag.pms5003.getPm10Ae();
|
||||||
|
@ -596,7 +596,7 @@ static void updateTvoc(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void updatePm(void) {
|
static void updatePm(void) {
|
||||||
if (ag.pms5003.isFailed() == false) {
|
if (ag.pms5003.connected()) {
|
||||||
measurements.pm01_1 = ag.pms5003.getPm01Ae();
|
measurements.pm01_1 = ag.pms5003.getPm01Ae();
|
||||||
measurements.pm25_1 = ag.pms5003.getPm25Ae();
|
measurements.pm25_1 = ag.pms5003.getPm25Ae();
|
||||||
measurements.pm10_1 = ag.pms5003.getPm10Ae();
|
measurements.pm10_1 = ag.pms5003.getPm10Ae();
|
||||||
|
@ -44,7 +44,7 @@ void loop() {
|
|||||||
if (ms >= 5000) {
|
if (ms >= 5000) {
|
||||||
lastRead = millis();
|
lastRead = millis();
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
if (ag.pms5003.isFailed() == false) {
|
if (ag.pms5003.connected()) {
|
||||||
PM2 = ag.pms5003.getPm25Ae();
|
PM2 = ag.pms5003.getPm25Ae();
|
||||||
Serial.printf("PM2.5 in ug/m3: %d\r\n", PM2);
|
Serial.printf("PM2.5 in ug/m3: %d\r\n", PM2);
|
||||||
Serial.printf("PM2.5 in US AQI: %d\r\n",
|
Serial.printf("PM2.5 in US AQI: %d\r\n",
|
||||||
|
Reference in New Issue
Block a user