testando

Dependencies:   mbed TextLCD2

Revision:
26:4123b9462158
Parent:
25:b0db528c1985
Child:
27:45f8125a0c0b
--- a/main_PM.cpp	Tue May 26 15:03:18 2020 +0000
+++ b/main_PM.cpp	Tue May 26 17:32:01 2020 +0000
@@ -409,6 +409,9 @@
     }  
 }
 
+//Variáveis para operação IHM
+
+char status_tela = "inicio";
 
 int main() {
     printf("\n%i",est_x);
@@ -504,5 +507,113 @@
         lcd.printf("Z: %4.1f", coord_z);
         */
         
+        tecla = teclado.ReadKey();
+        if(tecla =='1' && status_tela == 'inicio'){
+            funcao_pega1();
+            wait(50);
+            funcao_pega2();
+            status_tela = "novo";
+        }
+        else if(tecla == '2' && status_tela == 'inicio'){
+            funcao_salvo1();
+            wait(50);
+            funcao_salvo2();
+            status_tela = "salvo";
+        }
+        tecla = teclado.ReadKey();
+            if(tecla =='1' && status_tela =='novo'){
+            funcao_pega_forma();
+            status_tela ="forma";
+        }
+        else if(tecla =='2' && status_tela == 'novo'){
+            funcao_pega_volume();
+            status_tela = "volume";
+        }
+        else if(tecla == '3' && status_tela == 'novo'{
+            funcao_pega_pos_x();
+            status_tela = "pos_x";
+        }
+        else if(tecla == 'B' && status_tela == 'novo'){
+            funcao_inicio();
+            status_tela = "inicio";
+        }
+        else if(tecla == '1' && status_tela == 'salvo'){
+            funcao_salvo_agree1();
+            status_tela = "confirmacao";
+        }
+        else if(tecla =='2' && status_tela == 'salvo'){
+            funcao_salvo_agree1();
+            status_tela = "confirmacao";
+        }
+        else if(tecla =='B' && status_tela == 'salvo'){
+            funcao_inicio();
+            status_tela = "inicio";
+        }
+        
+        tecla = teclado.ReadKey();
+        if(tecla == "1" && status_tela == "forma"){
+            funcao_pega_forma_quad();
+            status_tela ="forma_quad";
+        }
+        else if(tecla == "2" && status_tela == "forma"){
+            funcao_pega_forma_red();
+            status_tela = "forma_quad";
+        }
+        else if(tecla == "B" && status_tela == "forma"){
+            funcao_pega_forma();
+            status_tela = "novo";
+        }
+        
+        tecla = teclado.ReadKey();
+        if(teclam == "A" && status_tela == "forma_quad"){
+            funcao_pega1();
+            wait(50);
+            funcao_pega2();
+            status_tela ="inicio";
+        }
+        else if(tecla == "B" && status_tela == "forma_quad"){
+            funcao_pega_forma();
+            status_tela = "forma";
+        }
+        else if(tecla == "A" && status_tela == "forma_red"){
+            funcao_pega1();
+            wait(50);
+            funcao_pega2();
+            status_tela ="inicio";
+        }
+        else if(tecla == "B" && status_tela == "forma_red"){
+            funcao_pega_forma();
+            status_tela = "forma";
+        }
+        else if(tecla == "A" && status_tela == "volume"){
+            funcao_pega1();
+            wait(50);
+            funcao_pega2();
+            status_tela ="inicio";
+        }
+        else if( tecla == "B" && status_tela == "volume"){
+            funcao_pega_forma();
+            status_tela = "forma";
+        }
+        else if(tecla == "A" && status_tela == "pos_x"){
+            funcao_pega_pos_y();  //colocar programação que contém o posicionamento do eixo y
+            status_tela = "pos_y";  
+        }
+        else if(tecla == "B" && status_tela == "pos_x"){
+            funcao_pega_forma();
+            status_tela = "forma";
+        }
+        
+        tecla = teclado.ReadKey();
+        if(tecla == "A" && status_tela == "pos_y"){
+            funcao_pega1();
+            wait(50);
+            funcao_pega2();
+            status_tela ="inicio";
+        }
+        else if(tecla == "B" && status_tela == "pos_y"){
+            funcao_pega_forma();
+            status_tela = "forma";
+        }
     }
 }