Team Scream Machine / Mbed 2 deprecated aclock

Dependencies:   MaxSonar RTC-DS1307 TextLCD mbed

main.cpp

Committer:
SausageSausage
Date:
2017-05-24
Revision:
0:514ef400f75b
Child:
1:aa2b8929a968

File content as of revision 0:514ef400f75b:

#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();
    }
}