FSLP Window USB Serial Output
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 |
--- /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