testando

Dependencies:   mbed TextLCD2

Revision:
34:1b5a00c55376
Parent:
33:a513498222c7
Child:
35:a8256801e9ab
Child:
39:f73cdb65c16c
--- a/main_PM.cpp	Wed May 27 15:00:54 2020 +0000
+++ b/main_PM.cpp	Wed May 27 15:13:23 2020 +0000
@@ -183,7 +183,22 @@
             status_tela ="forma";}
         else if(tecla =='2' && status_tela == "novo"){
             funcao_pega_volume();
-            status_tela = "volume";}
+            status_tela = "volume";
+            bool continuar = 1;
+            int volume = 0;
+            int multiplicador = 1; 
+            while(continuar){   
+                tecla = teclado.ReadKey();
+                if(tecla!= 'A' && tecla!='B' && tecla!='C' && tecla!='D' && tecla!='#' && tecla != '*'){
+                    volume = multiplicador*volume + (int)tecla;    
+                    multiplicador*=10;
+                }
+                else if(tecla == 'A'){
+                    lcd.printf("Volume: %d", volume);
+                    continuar = 0;
+                }
+            }   
+        }
         else if(tecla == '3' && status_tela == "novo"){
             funcao_pega_pos_x();
             status_tela = "pos_x";}