FSR

Dependencies:   FSR mbed

Files at this revision

API Documentation at this revision

Comitter:
cshao06
Date:
Thu Oct 22 17:36:14 2015 +0000
Commit message:
FSR

Changed in this revision

FSR.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/FSR.lib	Thu Oct 22 17:36:14 2015 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/cshao06/code/FSR/#d9520bf7eb9e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Oct 22 17:36:14 2015 +0000
@@ -0,0 +1,14 @@
+#include "mbed.h"
+#include "FSR.h"
+
+FSR fsr(p20, 10); // Pin 20 is used as the AnalogIn pin and a 10k resistor is used as a voltage divider
+
+int main(){
+    while (1)
+    {
+        printf("The raw data is %f\n", fsr.readRaw());
+        printf("The resistance of the FSR is %f\n", fsr.readFSRResistance());
+        printf("The weight on the FSR is %f\n\n", fsr.readWeight());
+        wait(0.3); //just here to slow down the output for easier reading
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Oct 22 17:36:14 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4f6c30876dfa
\ No newline at end of file