![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
pressures
Dependencies: KellerDruck_pressure PID PWM-Coil-driver Sensirion_SF04 VL6180
Fork of HSPFLOW by
main.cpp@8:72b6c4a5320a, 2017-08-16 (annotated)
- Committer:
- 212600191
- Date:
- Wed Aug 16 13:50:56 2017 +0000
- Revision:
- 8:72b6c4a5320a
- Parent:
- 7:fb77fbe65357
pressure;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dmwahl | 0:67debf2ccbc2 | 1 | #include "main.h" |
iwolf32 | 4:79b23d1fbcd1 | 2 | |
212600191 | 7:fb77fbe65357 | 3 | int numsamples =64; |
212600191 | 7:fb77fbe65357 | 4 | |
212600191 | 8:72b6c4a5320a | 5 | int i =0; |
212600191 | 7:fb77fbe65357 | 6 | |
212600191 | 7:fb77fbe65357 | 7 | |
iwolf32 | 5:8e47d5323647 | 8 | int main() |
dmwahl | 0:67debf2ccbc2 | 9 | { |
212600191 | 7:fb77fbe65357 | 10 | pc.baud(250000); |
212600191 | 6:c20cf19f7d9b | 11 | //t1.start(); |
212600191 | 6:c20cf19f7d9b | 12 | //pc.printf("Serenity Starting up..."); |
212600191 | 8:72b6c4a5320a | 13 | while (i<1){ |
212600191 | 6:c20cf19f7d9b | 14 | //float t= t1.read_ms(); |
212600191 | 8:72b6c4a5320a | 15 | //double High_Speed_Pressure1=0; |
212600191 | 7:fb77fbe65357 | 16 | double High_Speed_Pressure=0; |
212600191 | 7:fb77fbe65357 | 17 | //High_Speed_Pressure1 = analog_value.read(); // |
212600191 | 7:fb77fbe65357 | 18 | //High_Speed_Pressure1 = High_Speed_Pressure1*100*(14.6959/8.6); // Calibrate value to 1atm |
212600191 | 7:fb77fbe65357 | 19 | |
212600191 | 7:fb77fbe65357 | 20 | for (int j=0; j<numsamples; j++) { |
212600191 | 7:fb77fbe65357 | 21 | High_Speed_Pressure += analog_value.read();; |
212600191 | 7:fb77fbe65357 | 22 | |
212600191 | 7:fb77fbe65357 | 23 | } |
212600191 | 7:fb77fbe65357 | 24 | //High_Speed_Pressure_Calibrated = (High_Speed_Pressure - 14.6959); |
212600191 | 6:c20cf19f7d9b | 25 | //mainflow.Measure(FLOW); |
212600191 | 7:fb77fbe65357 | 26 | High_Speed_Pressure = (High_Speed_Pressure / numsamples); |
212600191 | 7:fb77fbe65357 | 27 | High_Speed_Pressure = High_Speed_Pressure*100*(14.6959/8.6); |
212600191 | 8:72b6c4a5320a | 28 | |
212600191 | 7:fb77fbe65357 | 29 | pc.printf("%.02f\r\n", High_Speed_Pressure); |
212600191 | 6:c20cf19f7d9b | 30 | //pc.printf("Hello\r"); |
iwolf32 | 5:8e47d5323647 | 31 | //pc.printf("%0.02fpsi raw: %u %.02f", High_Speed_Pressure, mainflow.flow.u16, t);*/ |
212600191 | 8:72b6c4a5320a | 32 | wait(.001); |
212600191 | 7:fb77fbe65357 | 33 | |
212600191 | 7:fb77fbe65357 | 34 | |
dmwahl | 0:67debf2ccbc2 | 35 | } |
dmwahl | 0:67debf2ccbc2 | 36 | } |
dmwahl | 0:67debf2ccbc2 | 37 |