![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Dust Sesnsor PMS5003
Dependencies: DustSenzor NetServices ThingSpeakEthernet mbed
Fork of PMS5003 by
main.cpp
- Committer:
- mpuric
- Date:
- 2017-06-05
- Revision:
- 9:07f9279c30f7
- Parent:
- 7:1da0a084cd69
- Child:
- 12:df83e01db08e
File content as of revision 9:07f9279c30f7:
#include "mbed.h" #include "ThingSpeak.h" #include "TextLCD.h" #include "DustSenzor.h" ThingSpeak ts("FI2NZGSOB8LSR8YX"); DustSenzor ds(p5, p9, p10); int main() { ds.stop(); float *ptr; ts.connect(); wait(1); while(1){ float res = ts.pull(282724, 1); if(res == 1){ ds.start(); } while( res == 1){ ptr = ds.read(); for( int i = 0; i < 6; i++) { ts.setField(*(ptr + i), i+1); } ts.putUp(); wait(15); res = ts.pull(282724, 1); } ds.stop(); } } /* void DustSenzor::modeSet(){ if(debounce.read_ms() > 250 && provjera==false) { set=1; debounce.reset(); provjera=true; } else if(debounce.read_ms() > 250 && provjera==true){ set=0; debounce.reset(); provjera=false; } } */