Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 1:db98edccd932
- Parent:
- 0:20ec80029ebe
--- a/main.cpp Sun Nov 29 14:50:18 2015 +0000
+++ b/main.cpp Sun Nov 29 23:43:52 2015 +0000
@@ -7,7 +7,7 @@
AnalogIn interno(PTB3);
InterruptIn sw1(SW1);
DigitalIn sw3(SW3);
-AnalogIn llave(PTA1);
+DigitalIn llave(PTA1);
TextLCD lcd(PTD3, PTA12, PTA4, PTA5, PTC8, PTC9, TextLCD::LCD16x2);
@@ -18,46 +18,63 @@
void menu (){
if(llave == 0){ //modo auto
+ wait(1);
lcd.cls();
do{
+ lcd.locate(0,0);
lcd.printf("temperatura");
- }while(sw1 == 1 || sw3 == 1);
+ }while(sw1 == 1 && sw3 == 1);
if(sw3 == 0){
+ lcd.cls();
+ wait(.5);
+ pc.printf("ingrese temperatura\r\n");
pc.scanf("%d", &temp);
pc.printf("se seteo la temperatura a %.0d\r\n", temp);
}
else{
lcd.cls();
do{
+ lcd.locate(0,0);
lcd.printf("tipo de banio");
- }while(sw1 == 1 || sw3 == 1);
+ }while(sw1 == 1 && sw3 == 1);
if(sw3 == 0){
+ wait(.20);
pc.scanf("%c", &tipo);
pc.printf("el tipo de banio es %c\r\n", tipo);
}
else{
lcd.cls();
do{
+ lcd.locate(0,0);
lcd.printf("horarios");
- }while(sw1 == 1 || sw3 == 1);
+ wait(.20);
+ }while(sw1 == 1 && sw3 == 1);
if(sw3 == 0){
+ wait(.20);
}
else{
+ wait(.15);
lcd.cls();
do{
+ lcd.locate(0,0);
lcd.printf("reloj");
- }while(sw1 == 1 || sw3 == 1);
+ wait(.20);
+ }while(sw1 == 1 && sw3 == 1);
if(sw3 == 0){
+ wait(1);
}
else{
lcd.cls();
do{
+ lcd.locate(0,0);
lcd.printf("salir");
- }while(sw1 == 1 || sw3 == 1);
+ wait(0.20);
+ }while(sw1 == 1 && sw3 == 1);
if(sw3 == 0){
+ wait(.20);
return;
}
- else{
+ else{
menu();
}}}}}}
else{
@@ -82,10 +99,10 @@
lcd.cls();
if(llave == 0){
- lcd.locate(0,8);
- lcd.printf("auto");
+ lcd.locate(8,1);
+ lcd.printf("Auto");
}else {
- lcd.locate(0,8);
+ lcd.locate(8,1);
lcd.printf("man");
}
casexterno = externo.read() * 3.3;
@@ -93,7 +110,7 @@
casinterno = interno.read() * 3.3;
tinterno = (casinterno + 2) * 100 / 8;
-
+ lcd.locate(0,0);
lcd.printf("int %.0f set %d",tinterno, temp);
lcd.locate(0,1);
lcd.printf("ext %.0f ", texterno);