Código para o menu no LCD

Dependencies:   mbed SDFileSystemSD TextLCD

Fork of TextLCD_HelloWorld2 by Wim Huiskamp

Files at this revision

API Documentation at this revision

Comitter:
claraluques
Date:
Tue May 15 14:35:25 2018 +0000
Parent:
19:2c890ae2d187
Child:
21:7603fe283ba4
Commit message:
arrumamos algumas chamadas de fun??o;

Changed in this revision

classes.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/classes.h	Tue May 15 13:07:03 2018 +0000
+++ b/classes.h	Tue May 15 14:35:25 2018 +0000
@@ -56,7 +56,8 @@
         }
         
         void start_program(void){
-            send("b");    
+            send("b");  
+            printf("b\n\r");  
         }
         
         void cancel_program(void){
@@ -82,8 +83,15 @@
         
         void jog(void){
             send("j");
+            printf("j\n\r"); 
         }
         
+        void kill_jog(void){
+            send("jk");
+            printf("jk\n\r"); 
+        }
+        
+        
         private:
             
             // PRIVATE FUNCTIONS ----------------------------------------------------------------------------------------------------------------------------------------
@@ -92,7 +100,7 @@
                 
                 for(int i = 0; i < msg.length(); i++){
                     Mach.putc(msg[i]);
-                    wait_ms(15);   
+                    wait_ms(20);   
                 }
             }       
 };
@@ -200,6 +208,8 @@
     void jog(){ //função tela jog
         bot_enter = 0;
         coords = 0;
+        machine.kill_jog();
+        wait(0.1);
         machine.jog();
         lcd.cls();
         lcd.locate(4,0);
@@ -219,8 +229,7 @@
         movercursor(1,3,10);       
         if (bot_enter!=penter){
             //coords = 1;
-            if (linha==1){ 
-                machine.save_point(1,2);               
+            if (linha==1){                
                 if (pontos>0){
                     pontos--;
                     cx_salva = cx;
@@ -236,6 +245,7 @@
                 func = 7;
                 }
             else if (linha==3) {
+                machine.kill_jog();
                 func = 1;
                 pontos = 10;
                 }
@@ -342,6 +352,7 @@
                 cola = 2;
                 func = 2;
                 }
+            machine.save_point(cola,2);
             }
         }
     
--- a/main.cpp	Tue May 15 13:07:03 2018 +0000
+++ b/main.cpp	Tue May 15 14:35:25 2018 +0000
@@ -471,20 +471,20 @@
     void botenter_press(void){          
               penter = bot_enter;
               bot_enter = !bot_enter;
-              printf("enter high");
+              //printf("enter high");
               }
           
 //função interrupt botão cima          
     void botcima_press(void){
               pcima = bot_cima;
               bot_cima = !bot_cima;
-              printf("cima high");
+              //printf("cima high");
               }
 
 //função interrupt botão baixo          
     void botbaixo_press(void){
               pbaixo = bot_baixo;
               bot_baixo = !bot_baixo;
-              printf("baixo high");
+              //printf("baixo high");
               }   
                     
\ No newline at end of file