Dust Sesnsor PMS5003
Dependencies: DustSenzor NetServices ThingSpeakEthernet mbed
Fork of PMS5003 by
main.cpp
- Committer:
- mpuric
- Date:
- 2017-06-08
- Revision:
- 12:df83e01db08e
- Parent:
- 9:07f9279c30f7
- Child:
- 13:5c98f1d10e70
File content as of revision 12:df83e01db08e:
#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(); } }