Steve Mylroie
/
HPM_Tester
New Tester
Fork of frdm_https_HPM by
Diff: Main.cpp
- Revision:
- 27:373612b1cd94
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Main.cpp Wed Dec 06 11:25:25 2017 +0000 @@ -0,0 +1,28 @@ +#include "mbed.h" +#include "HPM.h" + +#define TESTER_VERSION 1.0 + +Serial pc(USBTX, USBRX, 115200); + +#if MODE == 4 +RawSerial link(D0, D1); +#endif + +main() +{ + pc.printf("Starting HPM library Tester Version %s\n", TESTER_VERSION); +#if MODE == 4 + HPM pm(&link); +#else + HPM pm(D1, D0); //Create an instance of a HPM class object +#endif + pm.setLog(&pc); //Attach a log output stream + pm.startAutoRead(); //Start the sensor in continous read mode + for(int index = 0; index < 5; index++) { //Display 5 readings + pm.getPMReadings(); + } + pm.stopAutoRead(); //Shut the sensor down + + } +