reloj

Dependencies:   Debounced TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
OlySolano
Date:
Wed Apr 06 17:17:37 2016 +0000
Commit message:
reloj

Changed in this revision

Debounced.lib Show annotated file Show diff for this revision Revisions of this file
TextLCDre.lib Show annotated file Show diff for this revision Revisions of this file
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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Debounced.lib	Wed Apr 06 17:17:37 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/WarwickRacing/code/Debounced/#8992c13bbb9b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCDre.lib	Wed Apr 06 17:17:37 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#308d188a2d3a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Apr 06 17:17:37 2016 +0000
@@ -0,0 +1,55 @@
+#include "mbed.h"
+//#include "DebouncedIn.h"
+#include "TextLCD.h"
+
+Serial pc(USBTX,USBRX);
+TextLCD lcd(PTB9, PTB10, PTE2, PTE3, PTE4, PTE5);
+DigitalOut myled(LED1);
+DigitalIn pulsador1 (D3);
+DigitalIn pulsador2 (D4);
+int horas;
+int minutos;
+int segundos;
+DigitalOut alarma (D6);
+Timer t;
+
+int main()
+{
+    lcd.cls();
+    t.start();
+    do
+    {   
+        
+        segundos = t.read();
+        if(segundos == 60){
+            segundos=0;
+            t.reset();
+            minutos++;
+           
+        }
+        if(minutos==60){
+            minutos=0;
+            horas++;
+            
+        }
+        if(horas==24){
+            horas=0;
+        }
+                
+        lcd.locate(0,1);
+        lcd.printf("0%d:0%d:%d", horas, minutos, segundos);
+        lcd.locate(2,0);
+        lcd.printf("La hora es:");    
+    
+  }
+   while(1);{
+   
+    if (pulsador1==0){
+      horas++;
+    }
+       if (pulsador2==0){
+        minutos++;
+       }
+}
+
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Apr 06 17:17:37 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/c0f6e94411f5
\ No newline at end of file