testando

Dependencies:   mbed TextLCD2

Revision:
53:1d0bb62c117f
Parent:
52:dca562b09080
Child:
54:74a215a1f76b
--- a/main_PM.cpp	Thu May 28 22:42:53 2020 +0000
+++ b/main_PM.cpp	Fri May 29 00:10:03 2020 +0000
@@ -150,13 +150,12 @@
             status_tela = "inicio";
             funcao_inicio();}
 
-             /* tentativa de fazer o motor parar ao apertar algum dos fins de curso
+            /*tentativa de fazer o motor parar ao apertar algum dos fins de curso
         if(fdc_x == 0 || fdc_y == 0 || fdc_z == 0){
             for(int i = 0; i < 4; i++){eixox = parado[i];wait(t_motor);est_x = 1;}
             for(int i = 0; i < 4; i++){eixoy = parado[i];wait(t_motor);est_y = 1;}
             for(int i = 0; i < 4; i++){eixoz = parado[i];wait(t_motor);est_z = 1;}
-             */
-             
+             }*/
         if (x_mais == 0 && est_x == 1){for(int i = 0; i < 4; i++){eixox = parado[i];wait(t_motor);coord_x += 0;lcd.cls();lcd.printf("Limite de x atingido");}}
         if (y_mais == 0 && est_y == 1){for(int i = 0; i < 4; i++){eixoy = parado[i];wait(t_motor);coord_y += 0;lcd.cls();lcd.printf("Limite de y atingido");}}
         if (z_mais == 0 && est_z == 1){for(int i = 0; i < 4; i++){eixoz = parado[i];wait(t_motor);coord_z += 0;lcd.cls();lcd.printf("Limite de z atingido");}}     
@@ -283,7 +282,7 @@
             lcd.locate(18,1);lcd.printf("OK");
             wait(1);
             funcao_salvo_agree2();
-            status="salvo_confirmacao";
+            status_tela = "salvo_confirmacao";
             }//salva essa posição como correta
         else if(tecla =='2' && status_tela =="salvo_pos_certo_pega"){}
         else if(tecla =='B' && status_tela =="salvo_pos_certo_pega"){             
@@ -297,7 +296,7 @@
             wait(1);
             funcao_salvo_agree2();
             lcd.locate(18,1);lcd.printf("OK");
-            status="salvo_confirmacao";
+            status_tela = "salvo_confirmacao";
             }//salva essa posição como correta
         else if(tecla =='B' && status_tela =="salvo_conf_vol_pega"){             
             funcao_salvo_agree1();
@@ -310,7 +309,7 @@
             lcd.locate(18,2);lcd.printf("OK");
             wait(1);
             funcao_salvo_agree2();
-            status="salvo_confirmacao";
+            status_tela = "salvo_confirmacao";
             }//salva essa posição como correta
         else if(tecla =='2' && status_tela =="salvo_pos_certo_solta"){}
         else if(tecla =='B' && status_tela =="salvo_pos_certo_solta"){             
@@ -324,7 +323,7 @@
             wait(1);
             funcao_salvo_agree2();
             lcd.locate(18,2);lcd.printf("OK");    
-            status="salvo_confirmacao";        
+            status_tela = "salvo_confirmacao";        
             }//salva essa posição como correta
         else if(tecla =='2' && status_tela =="salvo_conf_vol_solta"){}
         else if(tecla =='B' && status_tela =="salvo_conf_vol_solta"){             
@@ -337,19 +336,25 @@
         if(tecla =='1' && status_tela =="novo"){
             funcao_pega_forma();
             status_tela ="forma";}
+            
         else if(tecla =='2' && status_tela == "novo"){
-            funcao_pega_volume();
+            int volume = 0;
+            printf("\n%d",volume);
+            funcao_pega_volume(); //!!!!!!!!!!!!!!!!!!!!!!!!!!!WTFFFFF
             status_tela = "volume";
             bool continuar = 1;
-            int volume = 0;
-            int multiplicador = 1; 
+            int multiplicador = 1;
             while(continuar){   
+                int volume = 0;
                 tecla = pega_tecla();
-                if(tecla!= 'A' && tecla!='B' && tecla!='C' && tecla!='D' && tecla!='#' && tecla != '*'){
+                if(tecla!= 'A' && tecla!='B'){
+                    lcd.locate(6,1);
                     volume = multiplicador*volume + (int)tecla;    
                     multiplicador*=10;
+                    //lcd.printf("Volume: %d", volume);
                 }
-                else if(tecla == 'A'){
+                if(tecla == 'A'){
+                    lcd.locate(0,2);
                     lcd.printf("Volume: %d", volume);
                     continuar = 0;
                 }