![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Ds1307
Dependencies: RTC-DS1307 TextLCD mbed
main.cpp
- Committer:
- jyrodriguezg
- Date:
- 2015-06-08
- Revision:
- 0:0616025d9f54
File content as of revision 0:0616025d9f54:
#include "mbed.h" #include "Rtc_Ds1307.h" #include "TextLCD.h" Rtc_Ds1307 rtc(PTE0, PTE1); TextLCD lcd(PTE5, PTE4, PTE3, PTE2, PTB11, PTB10); // rs, e, d4-d7 Serial pc(USBTX, USBRX, "pc"); int main(){ Rtc_Ds1307::Time_rtc tm = {}; rtc.startClock(); while(1) { rtc.getTime(tm); lcd.locate(0,0); lcd.printf("Hora:%02d:%02d:%02d\n\r",tm.hour, tm.min, tm.sec); lcd.locate(0,1); lcd.printf("Fech:%02d/%02d/%04d\n\r", tm.date, tm.mon, tm.year); } }