FSR
Revision 0:5521da8243b8, committed 2015-10-22
- Comitter:
- cshao06
- Date:
- Thu Oct 22 17:36:14 2015 +0000
- Commit message:
- FSR
Changed in this revision
--- /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
Force Sensitive Resistors (FSR)