Grupo T / Mbed OS GRUPOT
Revision:
10:cd868ca9997c
Parent:
9:d771a576e4fc
Child:
11:0e22a6fc7f87
--- a/main.cpp	Fri May 04 15:57:10 2018 +0000
+++ b/main.cpp	Fri May 04 16:01:07 2018 +0000
@@ -17,8 +17,8 @@
 
 // hardware input signal
 // end-of-stroke sensors
-InterruptIn endX1(D5);
-InterruptIn endX2(D13);
+InterruptIn endY1(D5);
+InterruptIn endY2(D13);
 
 // IHM for development
 AnalogIn joyX(A0);
@@ -50,8 +50,8 @@
 int z_plus = 1;
 int z_minus = 0;
 
-int x_limit_min = 0;
-int x_limit_max = 0;
+int y_limit_min = 0;
+int y_limit_max = 0;
 
 float ppsMax = 600.0;
 
@@ -77,11 +77,11 @@
 void move(int pps, int x_dir, int y_dir, int z_dir, int x_step, int y_step, int z_step);
 float distance(int steps, float pitch);
 
-void endX1Int_press(void);
-void endX1Int_release(void);
+void endY1Int_press(void);
+void endY1Int_release(void);
 
-void endX2Int_press(void);
-void endX2Int_release(void);
+void endY2Int_press(void);
+void endY2Int_release(void);
 
 // MAIN PROGRAM ----------------------------------------------------------------
 
@@ -90,11 +90,11 @@
 int main(){
     printf("Starting...\r\n");
     
-    endX1.fall(&endX1Int_press);
-    endX1.rise(&endX1Int_release);
+    endY1.fall(&endY1Int_press);
+    endY1.rise(&endY1Int_release);
     
-    endX2.fall(&endX2Int_press);
-    endX2.rise(&endX2Int_release);
+    endY2.fall(&endY2Int_press);
+    endY2.rise(&endY2Int_release);
     
     if(modeStatus){
         //Código de JOG
@@ -208,31 +208,31 @@
     //endX2.mode(PullUp);
 }
 
-void endX1Int_press(void){
+void endY1Int_press(void){
     //if(debounce.read_ms() > 50)
-    printf("X1 - press\n\r");
-    x_limit_min = 1;
+    printf("Y1 - press\n\r");
+    y_limit_min = 1;
     //debounce.reset();    
 }
 
-void endX1Int_release(void){
+void endY1Int_release(void){
     //if(debounce.read_ms() > 50)
-    printf("X1 - release\n\r");
-    x_limit_min = 0;
+    printf("Y1 - release\n\r");
+    y_limit_min = 0;
     //debounce.reset();    
 }
 
-void endX2Int_press(void){
+void endY2Int_press(void){
     //if(debounce.read_ms() > 50)
-    printf("X2 - press\n\r");
-    x_limit_max = 1;
+    printf("Y2 - press\n\r");
+    y_limit_max = 1;
     //debounce.reset();    
 }
 
-void endX2Int_release(void){
+void endY2Int_release(void){
     //if(debounce.read_ms() > 50)
-    printf("X2 - release\n\r");
-    x_limit_max = 0;
+    printf("Y2 - release\n\r");
+    y_limit_max = 0;
     //debounce.reset();    
 }