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 0:3d977c006001, committed 2015-10-20
- Comitter:
- sethnuon
- Date:
- Tue Oct 20 00:07:54 2015 +0000
- Commit message:
- FSLP
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 3d977c006001 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Oct 20 00:07:54 2015 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+Serial pc(USBTX, USBRX);
+
+DigitalInOut pinReference(p13);
+DigitalOut driveLine2(p14);
+AnalogIn senseLine3(p15);
+
+
+int main() {
+ while(1) {
+ pinReference.output();
+ pinReference = 0;
+ driveLine2 = 1;
+ float force = 0;
+ force = senseLine3.read();
+ wait(0.001);
+ pinReference.input();
+ driveLine2 = 0;
+ float position = 0;
+ position = senseLine3.read();
+ pc.printf("Force: %f", force);
+ pc.printf(" Position: %f\r\n", position);
+ wait(1);
+
+ }
+}
+
+
Force Sensing Linear Potentiometer