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:
lucasfontenla
Date:
Tue Feb 26 00:56:55 2019 +0000
Parent:
44:15968c7431c6
Commit message:
Uploading for Projeto Mecatronico 2019;

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	Mon Jun 11 23:38:52 2018 +0000
+++ b/classes.h	Tue Feb 26 00:56:55 2019 +0000
@@ -367,6 +367,7 @@
     
     //func 1    
     void menuprincipal(){ //função menu principal
+        machine.kill_jog();
         bot_enter = penter;
         sair = 0;
         lcd.cls();
@@ -444,7 +445,7 @@
                 pontos = 0;
                 maxpontos = 100;
                 func = 1;
-                pontos = 10;
+                //pontos = 10;
                 }
             }    
         }
@@ -526,6 +527,7 @@
     void telacola(){ //tela para escolher o tipo de sequencia da cola
         
         lcd.cls();
+        machine.kill_jog();
         bot_enter = penter;
         lcd.printf("P/ o proximo ponto:");
         lcd.locate(3,1);
@@ -541,7 +543,7 @@
                 }
             if (linha==1){
                 cola = 0;
-                if (pontos==0){
+                if (pontos==0 && maxpontos>0){
                     pontos++;
                     maxpontos--;
                     machine.save_point(cola,1.0);
@@ -750,12 +752,12 @@
     void wifi(){
         bot_enter = penter;
         lcd.cls();
-        lcd.locate(0,0);
+        lcd.locate(2,0);
         lcd.printf("Modo WiFi Ativo"); 
-        movercursor(3,3,5);
         lcd.locate(6,3);
         lcd.printf("Cancelar");
-        if (bot_enter!=penter){
+        movercursor(3,3,5);
+                if (bot_enter!=penter){
             if (linha==3){
                 func = 1;
                 }
@@ -885,7 +887,7 @@
         lcd.locate(2,0);
         lcd.printf("Escolha o nome:");
         lcd.locate(0,3);
-        lcd.printf("Segure OK p/ salvar");
+        lcd.printf("Segure V para salvar");
         coluna = 1;        
         escrever();
         if (sair==1){
@@ -1021,8 +1023,10 @@
     void deletepoint(){
         
         lcd.cls();
-        lcd.locate(1,1);
-        lcd.printf("Voce removeu o ultimo ponto");
+        lcd.locate(3,1);
+        lcd.printf("Voce removeu o");
+        lcd.locate(4,2);
+        lcd.printf("ultimo ponto");
         //lcd.locate(2,2);
         //lcd.printf("ESTA NA ORIGEM");
         wait(1);
@@ -1034,9 +1038,9 @@
         
         lcd.cls();
         lcd.locate(1,1);
-        lcd.printf("Nao existem pontos para remover");
-        //lcd.locate(2,2);
-        //lcd.printf("ESTA NA ORIGEM");
+        lcd.printf("Nao existem pontos");
+        lcd.locate(1,2);
+        lcd.printf("salvos p\ remover.");
         wait(1);
         func = 2;
         }
@@ -1048,7 +1052,7 @@
         lcd.locate(5,1);
         lcd.printf("Salvando");
         lcd.locate(1,2);
-        lcd.printf("%s", nome);
+        //lcd.printf("%s", nome);
         wait(1);
         func = 7;
         }
@@ -1061,7 +1065,7 @@
         lcd.locate(2,0);
         lcd.printf("DESEJA EXECUTAR?");
         lcd.locate(3,1);
-        lcd.printf("%s", arquivo);
+        //lcd.printf("%s", arquivo);
         lcd.locate(6,2);
         lcd.printf("Sim");
         lcd.locate(6,3);
@@ -1171,6 +1175,7 @@
     void tela_emergencia(void){
         
         lcd.cls();
+        machine.kill_jog();
         lcd.locate(0,1);
         lcd.printf("BOTAO DE EMERGENCIA");  
         lcd.locate(4,2);
@@ -1348,6 +1353,7 @@
      
         while(1){
             recv = Mach.getc();
+            printf("%c\n\r", recv);
             
             if(emerg){
                 func = 31;
@@ -1403,7 +1409,7 @@
                     cx = atof(coordx.c_str());
                     cy = atof(coordy.c_str());
                     cz = atof(coordz.c_str());
-                    printf("%s,%s,%s\n\r", coordx, coordy, coordz);
+                    //printf("%s,%s,%s\n\r", coordx, coordy, coordz);
                     break;
                     }
                 }
--- a/main.cpp	Mon Jun 11 23:38:52 2018 +0000
+++ b/main.cpp	Tue Feb 26 00:56:55 2019 +0000
@@ -159,7 +159,7 @@
 //função interrupt botão enter        
     void botenter_press(void){ 
     printf("ENTER!\n\r");
-    printf("timer: %.3f\n\r", enter_debounce_timer.read());
+    //printf("timer: %.3f\n\r", enter_debounce_timer.read());
         if(enter_debounce_timer.read()>0.2){        
             penter = bot_enter;
             bot_enter = !bot_enter;
@@ -174,8 +174,8 @@
 //função interrupt botão cima          
     void botcima_press(void){
         printf("CIMA!\n\r");
-        printf("timer: %.3f\n\r", cima_debounce_timer.read());
-        printf("timer: %.3f\n\r", baixo_debounce_timer.read());
+        //printf("timer: %.3f\n\r", cima_debounce_timer.read());
+        //printf("timer: %.3f\n\r", baixo_debounce_timer.read());
         if(cima_debounce_timer.read()>0.2){        
             pcima = bot_cima;
             bot_cima = !bot_cima;