![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
REV1
Dependencies: KellerDruck_pressure PID PWM-Coil-driver Sensirion_SF04 VL6180
Fork of TestBenchFlow by
Diff: main.cpp
- Revision:
- 3:9ff79ea3a294
- Parent:
- 1:d58df8cb271d
- Child:
- 4:79b23d1fbcd1
diff -r 471261505b2b -r 9ff79ea3a294 main.cpp --- a/main.cpp Thu Jul 20 20:48:12 2017 +0000 +++ b/main.cpp Mon Jul 24 15:38:39 2017 +0000 @@ -53,6 +53,7 @@ i2c1_m.lock(); timer.reset(); error = pumpPressure.readPT(); + error |= mixerPressure.readPT(); int wait = (200 - timer.read_ms()); i2c1_m.unlock(); Thread::wait(wait); @@ -106,13 +107,11 @@ while (true) { stdio_m.lock(); timer.reset(); - /*pc.printf("%.3fkPa %.2fPSI %.1fC %.1fF %02X %.2f%% %.0fRPM %.0f %s %.1f %.3f\n\r", - pumpPressure.pressureKPA, pumpPressure.pressurePSI, pumpPressure.temperatureC, - pumpPressure.temperatureF, pumpPressure.status, pump.read()*100, pumpRpm, - ((float)sfm7033.flow.i16 / sfm7033.scaleFactor.u16), sfm7033.flowUnitStr, (double)pot1*18, ((double)pot2-.002)*pumpMaxPSI);*/ - pc.printf("%.02fkPa %.02fpsi %.02fC %.02fF %02X %.2f%% %.0fRPM %u %.0f %s %.1f %.3f\r\n", - pumpPressure.pressureKPA, pumpPressure.pressurePSI, pumpPressure.temperatureC, pumpPressure.temperatureF, pumpPressure.status, pump.read()*100, pumpRpm, + pc.printf("%.02fkPa %.02fpsi %.02fC %.02fF %02X %.02fkPa %.02fpsi %.02fC %.02fF %02X %.2f%% %.0fRPM %u %.0f %s %.1f %.3f\r\n", + pumpPressure.pressureKPA, pumpPressure.pressurePSI, pumpPressure.temperatureC, pumpPressure.temperatureF, pumpPressure.status, + mixerPressure.pressureKPA, mixerPressure.pressurePSI, mixerPressure.temperatureC, mixerPressure.temperatureF, mixerPressure.status, + pump.read()*100, pumpRpm, sfm7033.flow.u16, (((float)sfm7033.flow.i16 / 2) / sfm7033.scaleFactor.u16), sfm7033.flowUnitStr, (double)pot1*18, ((double)pot2)*pumpMaxPSI);//, agentlevel; int wait = (1000 - timer.read_ms()); @@ -154,12 +153,12 @@ timer.reset(); if((double)pot1 < 0.05) { shutoff.off(); - pc.printf("shutoff off\r\n"); + //pc.printf("shutoff off\r\n"); //Thread::wait(1000); } if((double)pot1 >= 0.1) { shutoff.on(); - pc.printf("shutoff on\r\n"); + //pc.printf("shutoff on\r\n"); //Thread::wait(1000); } int wait = (200 - timer.read_ms()); @@ -204,13 +203,15 @@ while (true) { //pc.printf("%.02fkPa %.02fpsi %.02fC %.02fF\r\n", pumpPressure.pressureKPA, pumpPressure.pressurePSI, pumpPressure.temperatureC, pumpPressure.temperatureF); - /*shutoff.on(); - pc.printf("shutoff on\r\n"); - Thread::wait(1000); + if((double)pot1 >= 0.1) { + injector.on(); + } + //pc.printf("shutoff on\r\n"); + Thread::wait(5); - shutoff.off(); - pc.printf("shutoff off\r\n");*/ - Thread::wait(1000); + injector.off(); + //pc.printf("shutoff off\r\n");*/ + Thread::wait(495); } }