Display date and time on LCD screen. Starting date and time are specified by user with matrix keyboard

Dependencies:   TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
a00958821
Date:
Wed Oct 26 16:09:55 2016 +0000
Commit message:
Lab 6 ejercicio 1 y 2

Changed in this revision

TextLCD.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/TextLCD.lib	Wed Oct 26 16:09:55 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 Oct 26 16:09:55 2016 +0000
@@ -0,0 +1,47 @@
+#include "mbed.h"
+#include "TextLCD.h"
+
+ 
+Timer timer;
+Ticker ledOnOff;
+TextLCD lcd(D2,D3,D4,D5,D6,D7);
+DigitalOut led(D11);
+int sec;
+int min=59;
+int hor=11;
+
+void calc();
+void ledBlink();
+
+int main() {
+    led = 1;
+    ledOnOff.attach(ledBlink,1);
+    timer.start();
+      while(1){
+          sec = timer.read();
+      if(sec>=59)
+      {
+          min=min+1;
+          timer.stop();
+          timer.reset();
+          timer.start();
+      }
+      if(min==60)
+      {
+        hor=hor+1;
+        min=00;    
+      }
+      if(hor==12)
+      {
+        hor=0;
+      }
+        lcd.cls();
+        lcd.printf("%02d:%02d:%02d",hor,min,sec); 
+        wait(1);
+        }
+  }
+  
+  void ledBlink()
+  {
+      led = !led;
+    }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Oct 26 16:09:55 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/b0220dba8be7
\ No newline at end of file