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.
Dependencies: MaxSonar RTC-DS1307 TextLCD mbed
Diff: main.cpp
- Revision:
- 0:514ef400f75b
- Child:
- 1:aa2b8929a968
diff -r 000000000000 -r 514ef400f75b main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed May 24 15:56:58 2017 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+#include "TextLCD.h"
+#include "Rtc_Ds1307.h"
+
+Rtc_Ds1307 rtc(PTE0, PTE1);
+TextLCD lcd(PTE4, PTE5, PTE20, PTE21, PTE22, PTE23); // rs, e, d4-d7
+Serial pc(USBTX, USBRX);
+
+int main() {
+
+ Rtc_Ds1307::Time_rtc tm = {};
+ rtc.startClock();
+
+ while(1) {
+ if (rtc.getTime(tm) ) {
+ lcd.printf("The time is :\n%02d:%02d:%02d", tm.hour, tm.min, tm.sec);
+ }
+ wait(1);
+ lcd.cls();
+ }
+}
\ No newline at end of file