Skip to content
Snippets Groups Projects
Commit 58113442 authored by francois's avatar francois
Browse files

update

parent 2b005364
No related branches found
No related tags found
No related merge requests found
...@@ -244,7 +244,15 @@ void setup() { ...@@ -244,7 +244,15 @@ void setup() {
// enable pin is input as default // enable pin is input as default
pinMode( PM_ENABLE, INPUT ); pinMode( PM_ENABLE, INPUT );
digitalWrite( PM_ENABLE, LOW ); // useless ... till we set it as an ouput digitalWrite( PM_ENABLE, LOW ); // useless ... till we set it as an ouput
Serial.println(F("\n[PMS5003] activate PMS ..."));Serial.flush(); /*
Serial.println(F("\n[PMS5003] disabling "));Serial.flush();
pinMode( PM_ENABLE, OUTPUT );
while( true ) {
Serial.print(F("."));Serial.flush();
delay(1000);
}
*/
Serial.println(F("\n[PMS5003] PMS is active ..."));Serial.flush();
_lastActive = millis(); _lastActive = millis();
delay(500); delay(500);
/* /*
...@@ -275,10 +283,13 @@ void loop() { ...@@ -275,10 +283,13 @@ void loop() {
} }
// may we read ? // may we read ?
if( digitalRead(PM_ENABLE)==HIGH ) {
Serial.print(F("."));Serial.flush();
}
bool _res = (digitalRead(PM_ENABLE)==HIGH) && pms.read(data); bool _res = (digitalRead(PM_ENABLE)==HIGH) && pms.read(data);
if( _res ) { if( _res ) {
Serial.print("PM 1.0 (ug/m3): "); Serial.print("\nPM 1.0 (ug/m3): ");
Serial.println(data.PM_AE_UG_1_0); Serial.println(data.PM_AE_UG_1_0);
Serial.print("PM 2.5 (ug/m3): "); Serial.print("PM 2.5 (ug/m3): ");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment