electro

Dependencies:   mbed QEI mbed-os KeypadLib TextLCD

Revision:
2:4b27d3d7341a
Parent:
1:48c8726d6824
Child:
3:a4994da37d1f
diff -r 48c8726d6824 -r 4b27d3d7341a electrocoagulador_final.cpp
--- a/electrocoagulador_final.cpp	Fri Mar 01 22:43:46 2019 +0000
+++ b/electrocoagulador_final.cpp	Sat Mar 02 02:07:39 2019 +0000
@@ -88,25 +88,69 @@
     wait(3);
     lcd.cls();
 
+    lcd.locate(0,0);
+    lcd.printf("t_1=%f",temp_user_1);
+    lcd.locate(8,0);
+    lcd.printf("t_2=%f",temp_user_2);
+    lcd.locate(0,1);
+    lcd.printf("t_3=%f",temp_user_3);
+    lcd.locate(8,1);
+    lcd.printf("t_4=%f",temp_user_4);
+
+
     while(1) {
-        lcd.locate(0,0);
-        lcd.printf("t_1=%f",temp_user_1);
-        lcd.locate(8,0);
-        lcd.printf("t_2=%f",temp_user_2);
-        lcd.locate(0,1);
-        lcd.printf("t_3=%f",temp_user_3);
-        lcd.locate(8,1);
-        lcd.printf("t_4=%f",temp_user_4);
 
         char key = keypad.getKey();
-//        if(key=='A'){temp_user_1=10;}
-        
-        if(key=='A'){
-            }
+
+        //if(key=='A') {
+            //lcd.cls();
+            //lcd.locate(0,0);
+            //lcd.printf("%c",key);
+            //wait(3);
+ 
+                
+
+                //           lcd.printf("t_1=%f",temp_user_1);
+
+
+        //if(key=='A'){temp_user_1=10;}
+
+                if(key=='A'){
+                    while(llena<=2){
+                        switch(llena){
+                            case 0:
+                            if(llena==0 && keypad.getKey()!= '\0'){
+                            cadena[llena]=keypad.getKey();
+                            llena=llena +1;
+                            break;
+                            }
+
+                            case 1:
+                            if(llena==1 && keypad.getKey()!= '\0'){
+                            cadena[llena]=keypad.getKey();
+                            llena=llena+1;
+                            break;
+                            }
+
+                            case 2:
+                            if(llena==2 && keypad.getKey()!= '\0'){
+                            cadena[llena]=keypad.getKey();
+                            llena=llena+1;
+                            break;}
+                            
+                            default:
+                            break;
+                        }
+                    lcd.cls();
+                    temp_user_1=strtod(cadena,NULL);
+                    lcd.locate(0,0);
+                    lcd.printf("t_1=%f",temp_user_1);
+                    }
+
+                }
 
 
 
-    
 
-        }//termina while de main
-    }//termina main
+    }//termina while de main
+}//termina main