IHM com 4 botões e todas as telas de pontos

Dependencies:   TextLCD mbed

Fork of Menu_IHM by Rodrigo Lino

Revision:
9:d9148b367fd9
Parent:
8:bd5509788843
Child:
10:1c4ab7bc50b7
--- a/teste.cpp	Wed May 09 16:14:38 2018 +0000
+++ b/teste.cpp	Wed May 09 18:22:34 2018 +0000
@@ -25,6 +25,7 @@
 
 bool previous1=0, previous2=0;
 int menu=0;
+float x=420.69, y=420.69, z=420.69;
 
 void aumenta_menu(){
     menu = menu + 1;
@@ -82,12 +83,18 @@
             //lcd.setAddress(0,0);
             //lcd.printf("SELECIONE O PONTO 1"); // Ponto 1
             lcd.setCursor(TextLCD::CurOff_BlkOff);
+            lcd.setAddress(0,0);
+            lcd.printf("1-SALVAR PONTO 1");
             lcd.setAddress(0,1);
-            lcd.printf("1-SALVAR PONTO 1");
+            lcd.printf("2-VOLTAR");
             lcd.setAddress(0,2);
-            lcd.printf("2-VOLTAR");
-            lcd.setAddress(0,3);
-            lcd.printf("3-CANCELAR OPERACAO");
+            lcd.printf("3-CANCELAR ");
+            lcd.setAddress(11,1);
+            lcd.printf("X:%.2f",x);
+            lcd.setAddress(11,2);
+            lcd.printf("Y:%.2f",y);
+            lcd.setAddress(11,3);
+            lcd.printf("Z:%.2f",z);
            // previous1 = 1;
             printf("dentro do menu1\r\n");
             if(button1==apertado)
@@ -103,13 +110,24 @@
         while ((menu==2)&& (button1==solto) && (button2==solto) && (button3==solto) && (button4==solto)){
             //lcd.setAddress(0,0);
             //lcd.printf("SELECIONE O PONTO 2"); // Ponto 2
+            //x=x+0.42;
+            //y=y+0.17;
+            //z=z+0.21;
             lcd.setCursor(TextLCD::CurOff_BlkOff);
+            lcd.setAddress(0,0);
+            lcd.printf("1-SALVAR PONTO 2");
             lcd.setAddress(0,1);
-            lcd.printf("1-SALVAR PONTO 2");
+            lcd.printf("2-VOLTAR");
             lcd.setAddress(0,2);
-            lcd.printf("2-VOLTAR");
+            lcd.printf("3-CANCELAR");
             lcd.setAddress(0,3);
-            lcd.printf("3-CANCELAR OPERACAO");
+            lcd.printf("4-CONCLUIR");
+            lcd.setAddress(11,1);
+            lcd.printf("X:%.2f",x);
+            lcd.setAddress(11,2);
+            lcd.printf("Y:%.2f",y);
+            lcd.setAddress(11,3);
+            lcd.printf("Z:%.2f",z);
            // previous1 = 1;
             printf("dentro do menu2\r\n");   
             if(button1==apertado)
@@ -125,15 +143,24 @@
         while ((menu==3)&& (button1==solto) && (button2==solto) && (button3==solto) && (button4==solto)){
            // lcd.setAddress(0,0);
             //lcd.printf("SELECIONE O PONTO 3"); // Ponto 3
+            //x=x+0.42;
+            //y=y+0.17;
+            //z=z+0.21;
             lcd.setCursor(TextLCD::CurOff_BlkOff);
             lcd.setAddress(0,0);
             lcd.printf("1-SALVAR PONTO 3");
             lcd.setAddress(0,1);
-            lcd.printf("2-voltar");
+            lcd.printf("2-VOLTAR");
             lcd.setAddress(0,2);
-            lcd.printf("3-CANCELAR OPERACAO");
+            lcd.printf("3-CANCELAR");
             lcd.setAddress(0,3);
             lcd.printf("4-CONCLUIR");
+            lcd.setAddress(11,1);
+            lcd.printf("X:%.2f",x);
+            lcd.setAddress(11,2);
+            lcd.printf("Y:%.2f",y);
+            lcd.setAddress(11,3);
+            lcd.printf("Z:%.2f",z);
             //previous1 = 1;
             printf("dentro do menu3\r\n");   
             if(button1==apertado)
@@ -151,13 +178,19 @@
             //lcd.printf("SELECIONE O PONTO 3"); // Ponto 3
             lcd.setCursor(TextLCD::CurOff_BlkOff);
             lcd.setAddress(0,0);
-            lcd.printf("1-SALVAR PONTO 4");
+            lcd.printf("1-SALVAR 4");
             lcd.setAddress(0,1);
-            lcd.printf("2-voltar");
+            lcd.printf("2-VOLTAR");
             lcd.setAddress(0,2);
-            lcd.printf("3-CANCELAR OPERACAO");
+            lcd.printf("3-CANCELAR");
             lcd.setAddress(0,3);
             lcd.printf("4-CONCLUIR");
+            lcd.setAddress(11,1);
+            lcd.printf("X:%.2f",x);
+            lcd.setAddress(11,2);
+            lcd.printf("Y:%.2f",y);
+            lcd.setAddress(11,3);
+            lcd.printf("Z:%.2f",z);
             //previous1 = 1;
             printf("dentro do menu3\r\n");   
             if(button1==apertado)
@@ -175,13 +208,19 @@
             //lcd.printf("SELECIONE O PONTO 3"); // Ponto 3
             lcd.setCursor(TextLCD::CurOff_BlkOff);
             lcd.setAddress(0,0);
-            lcd.printf("1-SALVAR PONTO 5");
+            lcd.printf("1-SALVAR 5");
             lcd.setAddress(0,1);
-            lcd.printf("2-voltar");
+            lcd.printf("2-VOLTAR");
             lcd.setAddress(0,2);
-            lcd.printf("3-CANCELAR OPERACAO");
+            lcd.printf("3-CANCELAR");
             lcd.setAddress(0,3);
             lcd.printf("4-CONCLUIR");
+            lcd.setAddress(11,1);
+            lcd.printf("X:%.2f",x);
+            lcd.setAddress(11,2);
+            lcd.printf("Y:%.2f",y);
+            lcd.setAddress(11,3);
+            lcd.printf("Z:%.2f",z);
             //previous1 = 1;
             printf("dentro do menu3\r\n");   
             if(button1==apertado)
@@ -196,12 +235,12 @@
         lcd.cls();
         while ((menu==6)&& (button1==solto) && (button2==solto) && (button3==solto) && (button4==solto)){
             lcd.setCursor(TextLCD::CurOff_BlkOff);
-            lcd.setAddress(0,0);
-            lcd.printf("Pontos salvos!");
+            lcd.setAddress(3,0);
+            lcd.printf("PONTOS SALVOS!");
             lcd.setAddress(0,2);
-            lcd.printf("1-Voltar ao menu");
+            lcd.printf("1-VOLTAR AO MENU");
             lcd.setAddress(0,3);
-            lcd.printf("2-ressalvar pontos");
+            lcd.printf("2-RESSALVAR PONTOS");
             printf("dentro do menu4\r\n");
             if(button1==apertado)
             {menu=0;}