Esta última actualización contiene el código funcional en las 10 funciones.

Dependencies:   mbed

Fork of jc by Sist. Piccolo

Files at this revision

API Documentation at this revision

Comitter:
jonnas58328
Date:
Fri Nov 24 23:09:23 2017 +0000
Parent:
2:773082426491
Commit message:
Last Update 24.11.17;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 773082426491 -r c7e3f75d4f10 main.cpp
--- a/main.cpp	Fri Nov 24 21:19:29 2017 +0000
+++ b/main.cpp	Fri Nov 24 23:09:23 2017 +0000
@@ -2,6 +2,7 @@
 #include "mbed.h"
 #include "math.h"
 #include "cstdlib"
+#include "InterruptIn.h"
 
 //--------------------------DECLARACON DE CONTANTES-------------------------------
 #define MAXPOS 255
@@ -18,10 +19,10 @@
 PwmOut myServoY(PB_4); //MOTOR EJE Y
 PwmOut myServoZ(PB_10);//MOTOR EJE Z
 
-InterruptIn mybutton2(PA_0);
+InterruptIn boton(PC_0);
 InterruptIn mybutton(USER_BUTTON);
 Serial command(USBTX, USBRX); //COMUNICACION SERIAL
-Serial Sdebug(USBTX, USBRX); 
+Serial Sdebug(USBTX, USBRX);  //DEBUG SERIAL
 DigitalOut led(LED1);          //DECLARACION LED DE LA PLACA
  
 //---------------------------DEFINICION COMANDOS POR CONSOLA---------------------- 
@@ -318,11 +319,10 @@
       if(x2==r)
       {
       wait(1);  
-    }
     home();
     }
         
-        }
+}
 //-------------------------------FUNCION REANUDAR---------------------------------
     void reanudar(){
         
@@ -337,15 +337,18 @@
        led = !led;                            
        command.printf("piccolo en pausa \n");
        wait (5);
-       return; 
+       //return; 
        
     }
        
 //-------------------------------FUNCION PARE-------------------------------------            
 void stop() //Funcion para detener el programa  
     {
+    command.printf("piccolo en Stop \n");
+    home();  
     exit(0);
-    home();           
+    
+             
     }  
 
 void command_exe()
@@ -469,6 +472,7 @@
             Read_command();
             mybutton.fall(&pause);
             mybutton.rise(&reanudar);
+            boton.fall(&stop);
             if (check_command()){
                 command_exe();
             }