testando

Dependencies:   mbed TextLCD2

Revision:
28:c4733814201a
Parent:
27:45f8125a0c0b
Child:
29:76d952358896
--- a/main_PM.cpp	Tue May 26 17:40:12 2020 +0000
+++ b/main_PM.cpp	Tue May 26 20:52:31 2020 +0000
@@ -394,7 +394,7 @@
 void emergencia()
 {
     while(emergencia_botao == 0){
-        rele1 = 0;
+        //rele1 = 0;
         eixox = 0b0000;
         eixoy = 0b0000;
         eixoz = 0b0000;
@@ -404,8 +404,8 @@
         lcd.printf("    acionado    ");
         lcd.locate(0,2);
         lcd.printf("Operação pausada");
-        lcd.locate(0,3);
-        lcd.printf(");       
+        //lcd.locate(0,3);
+        //lcd.printf(");       
     }  
 }
 
@@ -422,7 +422,7 @@
 
 //Variáveis para operação IHM
 
-char status_tela = "inicio";
+const char *status_tela = "inicio";
 
 int main() {
     printf("\n%i",est_x);
@@ -435,8 +435,8 @@
     lcd.printf("automatizado");
     lcd.locate(0,3);
     lcd.printf("de pipetagem");
-    wait(10);
-    lcd.cls()
+    wait(1);
+    lcd.cls();
     lcd.printf("Por favor, aceite");
     lcd.locate(0,1);
     lcd.printf("o zeramento do seu");
@@ -445,11 +445,11 @@
     lcd.locate(0,3);
     lcd.printf("A - próximo");
     tecla = teclado.ReadKey(); 
-    if(tecla == "A"){
+    if(tecla == 'A'){
         zeramento();    
     }
     else{
-        lcd.cls()
+        lcd.cls();
         lcd.printf("Enquanto não for");
         lcd.locate(0,1);
         lcd.printf("feito o zeramente o ");
@@ -457,7 +457,7 @@
         lcd.printf("sistema não pode operar");
         lcd.locate(0,3);
         lcd.printf("A - próximo");
-        if (tecla == "A"){
+        if (tecla == 'A'){
             zeramento();
         }     
     }
@@ -541,110 +541,109 @@
         */
         
         tecla = teclado.ReadKey();
-        if(tecla =='1' && status_tela == 'inicio'){
+        if(tecla =='1' && status_tela == "inicio"){
             funcao_pega1();
             wait(50);
             funcao_pega2();
             status_tela = "novo";
         }
-        else if(tecla == '2' && status_tela == 'inicio'){
+        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'){
+            if(tecla =='1' && status_tela =="novo"){
             funcao_pega_forma();
             status_tela ="forma";
         }
-        else if(tecla =='2' && status_tela == 'novo'){
+        else if(tecla =='2' && status_tela == "novo"){
             funcao_pega_volume();
             status_tela = "volume";
         }
-        else if(tecla == '3' && status_tela == 'novo'{
+        else if(tecla == '3' && status_tela == "novo"){
             funcao_pega_pos_x();
             status_tela = "pos_x";
         }
-        else if(tecla == 'B' && status_tela == 'novo'){
+        else if(tecla == 'B' && status_tela == "novo"){
             funcao_inicio();
             status_tela = "inicio";
         }
-        else if(tecla == '1' && status_tela == 'salvo'){
+        else if(tecla == '1' && status_tela == "salvo"){
             funcao_salvo_agree1();
             status_tela = "confirmacao";
         }
-        else if(tecla =='2' && status_tela == 'salvo'){
+        else if(tecla =='2' && status_tela == "salvo"){
             funcao_salvo_agree1();
             status_tela = "confirmacao";
         }
-        else if(tecla =='B' && status_tela == 'salvo'){
+        else if(tecla =='B' && status_tela == "salvo"){
             funcao_inicio();
             status_tela = "inicio";
         }
-        
         tecla = teclado.ReadKey();
-        if(tecla == "1" && status_tela == "forma"){
+        if(tecla == '1' && status_tela == "forma"){
             funcao_pega_forma_quad();
             status_tela ="forma_quad";
         }
-        else if(tecla == "2" && status_tela == "forma"){
+        else if(tecla == '2' && status_tela == "forma"){
             funcao_pega_forma_red();
             status_tela = "forma_quad";
         }
-        else if(tecla == "B" && status_tela == "forma"){
+        else if(tecla == 'B' && status_tela == "forma"){
             funcao_pega_forma();
             status_tela = "novo";
         }
         
         tecla = teclado.ReadKey();
-        if(teclam == "A" && status_tela == "forma_quad"){
+        if(tecla == 'A' && status_tela == "forma_quad"){
             funcao_pega1();
             wait(50);
             funcao_pega2();
             status_tela ="inicio";
         }
-        else if(tecla == "B" && status_tela == "forma_quad"){
+        else if(tecla == 'B' && status_tela == "forma_quad"){
             funcao_pega_forma();
             status_tela = "forma";
         }
-        else if(tecla == "A" && status_tela == "forma_red"){
+        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"){
+        else if(tecla == 'B' && status_tela == "forma_red"){
             funcao_pega_forma();
             status_tela = "forma";
         }
-        else if(tecla == "A" && status_tela == "volume"){
+        else if(tecla == 'A' && status_tela == "volume"){
             funcao_pega1();
             wait(50);
             funcao_pega2();
             status_tela ="inicio";
         }
-        else if( tecla == "B" && status_tela == "volume"){
+        else if( tecla == 'B' && status_tela == "volume"){
             funcao_pega_forma();
             status_tela = "forma";
         }
-        else if(tecla == "A" && status_tela == "pos_x"){
+        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"){
+        else if(tecla == 'B' && status_tela == "pos_x"){
             funcao_pega_forma();
             status_tela = "forma";
         }
         
         tecla = teclado.ReadKey();
-        if(tecla == "A" && status_tela == "pos_y"){
+        if(tecla == 'A' && status_tela == "pos_y"){
             funcao_pega1();
             wait(50);
             funcao_pega2();
             status_tela ="inicio";
         }
-        else if(tecla == "B" && status_tela == "pos_y"){
+        else if(tecla == 'B' && status_tela == "pos_y"){
             funcao_pega_forma();
             status_tela = "forma";
         }