mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-30 08:57:17 +02:00
v1.0.1
-Fixed getCO2 function
This commit is contained in:
BIN
examples/C02_PM_SHT/.DS_Store
vendored
Normal file
BIN
examples/C02_PM_SHT/.DS_Store
vendored
Normal file
Binary file not shown.
27
examples/C02_PM_SHT/C02_PM_SHT.ino
Normal file
27
examples/C02_PM_SHT/C02_PM_SHT.ino
Normal file
@ -0,0 +1,27 @@
|
||||
#include <AirGradient.h>
|
||||
AirGradient ag = AirGradient();
|
||||
|
||||
void setup(){
|
||||
Serial.begin(9600);
|
||||
ag.PMS_Init();
|
||||
ag.C02_Init();
|
||||
ag.TMP_RH_Init(0x44); //check for SHT sensor with address 0x44
|
||||
}
|
||||
|
||||
void loop(){
|
||||
|
||||
int PM2 = ag.getPM2();
|
||||
Serial.print("PM2: ");
|
||||
Serial.println(PM2);
|
||||
|
||||
int CO2 = ag.getC02();
|
||||
Serial.print("C02: ");
|
||||
Serial.println(CO2);
|
||||
|
||||
TMP_RH result = ag.periodicFetchData();
|
||||
Serial.print("Humidity: ");
|
||||
Serial.print(result.rh);
|
||||
Serial.print(" Temperature: ");
|
||||
Serial.println(result.t);
|
||||
delay(5000);
|
||||
}
|
Reference in New Issue
Block a user