ldc+pulsador

Dependencies:   mbed TextLCD

Files at this revision

API Documentation at this revision

Comitter:
pablolopez89
Date:
Thu May 16 14:22:30 2019 +0000
Parent:
2:ad0b044d0a10
Commit message:
LDC + Pulsadores

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r ad0b044d0a10 -r 3e6485b2c9bb main.cpp
--- a/main.cpp	Sat Dec 04 11:31:07 2010 +0000
+++ b/main.cpp	Thu May 16 14:22:30 2019 +0000
@@ -1,10 +1,93 @@
-// Hello World! for the TextLCD
 
 #include "mbed.h"
 #include "TextLCD.h"
 
-TextLCD lcd(p15, p16, p17, p18, p19, p20); // rs, e, d4-d7
+TextLCD lcd(D12, D11, D5, D4, D3, D2, TextLCD::LCD16x2); // rs, e, d4, d5, d6, d7 // LCD
+
+DigitalIn pin1(D6); // opcion 1
+DigitalIn pin2(D7); // opcion 2
+DigitalIn pin3(D8); // opcion 3
+DigitalIn pin4(D9); // opcion 4
+
+DigitalOut myled(LED1);
 
-int main() {
-    lcd.printf("Hello World!\n");
-}
+//int main() 
+//{
+//    lcd.printf(" INICIALIZANDO \n");
+//    lcd.printf("   BIENVENIDO   \n");
+//    
+//    lcd.cls();
+//    
+//}
+int main() 
+{
+    
+    //pin1.mode(PullUp);
+    //pin2.mode(PullUp);
+    //pin3.mode(PullUp);
+    //pin4.mode(PullUp);
+    
+    lcd.cls();
+    lcd.printf(" INICIALIZANDO \n");
+    lcd.printf("   BIENVENIDO   \n");
+    wait(2);
+    
+    while (1) 
+    {
+        lcd.cls();
+        lcd.printf("   SELECCIONE  \n");
+        lcd.printf("   UNA OPCION  \n");
+        wait(2);
+   
+        lcd.cls();
+        lcd.printf("1. Test Aire ");
+        wait(1); 
+       
+        lcd.cls();    
+        lcd.printf("2. Test Humedad ");
+        wait(1);
+     
+        lcd.cls();    
+        lcd.printf("3. Test Tierra ");
+        wait(1); 
+   
+        lcd.cls();
+        lcd.printf("4. Test Temperatura ");
+        wait(1);
+
+
+        lcd.cls();
+        lcd.printf("   SELECCIONE  \n");
+        lcd.printf("   UNA OPCION  \n");
+        wait(2);
+        
+        if(pin1==1)
+        {
+            myled=1;
+            lcd.cls();
+            lcd.printf(" Calidad Aire ");
+            lcd.printf(" ppm = 1000 ");
+            wait(2);
+            
+        }
+        else if(pin1==0)
+        {
+            myled=0;
+        }
+            
+        if(pin2==1)
+        {
+            myled=1;
+            lcd.cls();
+            lcd.printf("    Humedad    ");
+            lcd.printf("  15 porciento ");
+            wait(2);
+            
+        }
+        else if(pin2==0)
+        {
+            myled=0;
+        }
+   
+      }
+}
\ No newline at end of file
diff -r ad0b044d0a10 -r 3e6485b2c9bb mbed.bld
--- a/mbed.bld	Sat Dec 04 11:31:07 2010 +0000
+++ b/mbed.bld	Thu May 16 14:22:30 2019 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file