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.
Revision 6:ad77671aac31, committed 2020-01-23
- Comitter:
 - the_nabil
 - Date:
 - Thu Jan 23 07:58:47 2020 +0000
 - Parent:
 - 5:d9520bf7eb9e
 - Commit message:
 - FSR
 
Changed in this revision
--- /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