
Test program for SPS30
Diff: main.cpp
- Revision:
- 3:572adaa86366
- Parent:
- 2:225c3f2a2a8a
- Child:
- 4:91fa1c5ebbe1
--- a/main.cpp Mon Mar 04 05:56:06 2019 +0000 +++ b/main.cpp Tue Mar 05 03:06:13 2019 +0000 @@ -65,6 +65,9 @@ int count = 0; // string mass_1p0, mass_2p5, mass_4p0, mass_10p0, num_0p5, num_1p0, num_2p5, num_4p0, num_10p0, typ_pm_size; pc.printf("Ready...\r\n"); + pc.printf(" count | MASS CONCENTRATION (ug/m3) | NUMBER CONCENTRATION (#/cm3) | Typical Particle Size \r\n"); + pc.printf(" | PM1.0 | PM2.5 | PM4.0 | PM10.0 | PM0.5 | PM1.0 | PM2.5 | PM4.0 | PM10.0 | (um) \r\n"); + pc.printf("---------------------------------------------------------------------------------------------------------------------------\r\n"); while(1) { myled = !myled; @@ -75,15 +78,10 @@ uint8_t crcc = sps.readMeasurement(); count++; if(crcc != sps30::SPSnoERROR) pc.printf("ERROR: %d\r\n", crcc); - else pc.printf("%5d -> MASS CONCENTRATION (ug/m3) \r\n " - "PM1.0: %7.3f PM2.5: %7.3f PM4.0: %7.3f PM10.0: %7.3f\r\n " - "NUMBER CONCENTRATION (#/cm3) \r\n " - "PM0.5: %7.3f PM1.0: %7.3f PM2.5: %7.3f PM4.0: %7.3f PM10.0: %7.3f \r\n " - "Typical Particle Size (um): %7.3f \r\n", + else pc.printf(" %5d | %7.3f | %7.3f | %7.3f | %7.3f | %7.3f | %7.3f | %7.3f | %7.3f | %7.3f | %7.3f \r\n", \ count, sps.mass_1p0_f, sps.mass_2p5_f, sps.mass_4p0_f, sps.mass_10p0_f, sps.num_0p5_f, \ sps.num_1p0_f, sps.num_2p5_f, sps.num_4p0_f, sps.num_10p0_f, sps.typ_pm_size_f); } wait(5); - count++; } }