Grupo T / Mbed OS GRUPOT
Revision:
13:0f385bfe3e0d
Parent:
12:801e58a7137c
Child:
14:7cc41420a12c
--- 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);
     }  
 }