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.
Diff: main.cpp
- Revision:
- 13:0f385bfe3e0d
- Parent:
- 12:801e58a7137c
- Child:
- 14:7cc41420a12c
diff -r 801e58a7137c -r 0f385bfe3e0d main.cpp
--- a/main.cpp Fri May 04 17:55:03 2018 +0000
+++ b/main.cpp Fri May 04 18:52:34 2018 +0000
@@ -17,6 +17,9 @@
// hardware input signal
// end-of-stroke sensors
+InterruptIn endX1(D14);
+InterruptIn endX2(D10);
+
InterruptIn endY1(D5);
InterruptIn endY2(D13);
@@ -43,8 +46,8 @@
int y_dir;
int z_dir;
-int x_plus = 1;
-int x_minus = 0;
+int x_plus = 0;
+int x_minus = 1;
int y_plus = 1;
int y_minus = 0;
int z_plus = 1;
@@ -202,6 +205,13 @@
Y = distance(totalY, yPitch);
printf("X: %.2f Y: %.2f\r\n", X, Y);
+
+ zeroX(ppsMax);
+
+ X = distance(totalX, xPitch);
+ Y = distance(totalY, yPitch);
+
+ printf("X: %.2f Y: %.2f\r\n", X, Y);
}
}