flow to bluetooth

Dependencies:   mbed SoftSerial

Files at this revision

API Documentation at this revision

Comitter:
christodoulos
Date:
Thu May 30 08:26:56 2019 +0000
Commit message:
flow to bluetooth;

Changed in this revision

SoftSerial.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SoftSerial.lib	Thu May 30 08:26:56 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/Sissors/code/SoftSerial/#a0029614de72
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu May 30 08:26:56 2019 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+#include <SoftSerial.h>
+
+Serial ble(A4,A5);
+AnalogIn flowIn(A2);
+
+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());     
+        } 
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu May 30 08:26:56 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc
\ No newline at end of file