Dependencies:   KellerDruck_pressure PID PWM-Coil-driver Sensirion_SF04 VL6180

Fork of HSPFLOWFINAL by jack kemnitz

Committer:
212600191
Date:
Tue Aug 08 21:11:27 2017 +0000
Revision:
7:fb77fbe65357
Parent:
6:c20cf19f7d9b
Child:
8:72b6c4a5320a
sampling pressure;

Who changed what in which revision?

UserRevisionLine numberNew 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 7:fb77fbe65357 5
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 7:fb77fbe65357 13 for (int i=0; i<100000; i++){
212600191 6:c20cf19f7d9b 14 //float t= t1.read_ms();
212600191 7:fb77fbe65357 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 7:fb77fbe65357 28 pc.printf("%.02f\r\n", High_Speed_Pressure);
212600191 6:c20cf19f7d9b 29 //pc.printf("Hello\r");
iwolf32 5:8e47d5323647 30 //pc.printf("%0.02fpsi raw: %u %.02f", High_Speed_Pressure, mainflow.flow.u16, t);*/
212600191 7:fb77fbe65357 31 wait(.01);
212600191 7:fb77fbe65357 32
212600191 7:fb77fbe65357 33
dmwahl 0:67debf2ccbc2 34 }
dmwahl 0:67debf2ccbc2 35 }
dmwahl 0:67debf2ccbc2 36