Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- mehrnaz
- Date:
- 2019-06-04
- Revision:
- 1:08bbc3ecd836
- Parent:
- 0:d034cdad5b6d
- Child:
- 2:ef98576cd67b
File content as of revision 1:08bbc3ecd836:
#include "mbed.h"
#include <SoftSerial.h>
Serial ble(A4,A5);
AnalogIn flowIn(A3);
float flowVal1;
float flowVal2;
float Pressure;
float finalflow;
float flow()
{
flowVal1=3.3*flowIn; //Logic level 3.3
flowVal2 = 1.5*flowVal1; //5v
Pressure =(125*flowVal2)-62.5;
finalflow=(0.1989*sqrt(Pressure))+0.0284; //flow in litter per min
return finalflow;
}
int main(){
ble.baud(9600);
while(1){
ble.printf("E2.7, %f, 3.3\n", flow());
}
}