Files
arduino/examples/PM2_SIMPLE/PM2_SIMPLE.ino

17 lines
227 B
Arduino
Raw Normal View History

2020-07-24 21:52:28 +08:00
#include <AirGradient.h>
AirGradient ag = AirGradient();
void setup(){
Serial.begin(9600);
ag.PMS_Init();
}
void loop(){
int PM2 = ag.getPM2_Raw();
2020-07-24 21:52:28 +08:00
Serial.print("PM2: ");
Serial.println(ag.getPM2());
2020-07-24 21:52:28 +08:00
delay(5000);
}