testando

Dependencies:   mbed TextLCD2

Revision:
14:69d8f50c2336
Parent:
13:257302e01c7c
--- a/main_PM.cpp	Mon May 25 16:03:40 2020 +0000
+++ b/main_PM.cpp	Mon May 25 17:00:02 2020 +0000
@@ -47,16 +47,21 @@
 char tecla;
 
 while(1) {
-         int solta = 1;
-         tecla = teclado.ReadKey();                   //read the current key pressed
-         if(tecla == '\0') solta = 1;                       //set the flag when all keys are released
-
-         if((tecla != '\0') && (solta == 1)) {  //if a key is pressed AND previous key was released
-             printf("%c\n", tecla);            
-             solta = 0;                 //clear the flag to indicate that key is still pressed
-             wait(0.1);
-         }
-     
+     int solta = 1;
+     tecla = teclado.ReadKey();                   //read the current key pressed
+     if(tecla == '\0') solta = 1;                       //set the flag when all keys are released
+    
+     if((tecla != '\0') && (solta == 1)) {  //if a key is pressed AND previous key was released
+         printf("%c\n", tecla);            
+         solta = 0;                 //clear the flag to indicate that key is still pressed
+         wait(0.1); 
+     }
+    if (tecla == '1'){
+        lcd.cls();
+        lcd.printf("A-Novo programa");
+        lcd.locate(0,1);
+        lcd.printf("B-Carregar programa");
+        }
     if (x_mais == 0){
         a1 = 1;b1 = 1;wait(t_motor);
         a1 = 0;c1 = 1;wait(t_motor);