![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
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
diff -r 000000000000 -r 5521da8243b8 FSR.lib --- /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
diff -r 000000000000 -r 5521da8243b8 main.cpp --- /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
diff -r 000000000000 -r 5521da8243b8 mbed.bld --- /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