Projet_BMC / Mbed 2 deprecated FSR

Dependencies:   mbed USBDevice

Files at this revision

API Documentation at this revision

Comitter:
the_nabil
Date:
Thu Jan 23 07:58:47 2020 +0000
Parent:
5:d9520bf7eb9e
Commit message:
FSR

Changed in this revision

USBDevice.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/USBDevice.lib	Thu Jan 23 07:58:47 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/USBDevice/#53949e6131f6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Jan 23 07:58:47 2020 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+#include "FSR.h"
+#include "USBSerial.h"
+#include "math.h"
+
+//Virtual serial port over USB
+
+USBSerial serial;
+
+AnalogIn analog_value(A0);
+float F ; float P; float V ; 
+int main(){
+    float meas;
+    while (1)
+    {
+        meas = analog_value.read(); 
+        //V= meas*5;
+        V= meas*3.3;
+        P = 9146.3*(pow(V,3))-47648*(pow(V,2))+103084*V-47228;
+        F = P *0.00193/9.81;
+
+        serial.printf("V_out = %f\n", V);
+        if (P>0 ) 
+        {
+        serial.printf("Pression_out = %f\n", P);
+        serial.printf("KG= %f\n", F);
+        }
+        else
+        {
+        serial.printf("Pression_out = 0 \n");
+        serial.printf("KG= 0 \n");
+        
+        }
+        wait(0.5); //just here to slow down the output for easier reading
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Jan 23 07:58:47 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file