Shivanand Gowda / Mbed OS Internal_RTC

Dependencies:   InternalRTC

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "RTC.h"
00003 
00004 DigitalOut led1(LED1);
00005 Thread Time;
00006 
00007   char Current_Time[15]={'\0'};
00008 void Print_Date_Time(void)
00009 {
00010     while(true)
00011     {
00012         Get_Date_Time(Current_Time);
00013         led1=!led1;
00014         printf("Date and Time is %s\r\n",Current_Time);
00015         wait(1);
00016     }  
00017 }
00018 
00019 
00020 int main() 
00021 {
00022     
00023     printf("Am here\r\n");
00024     char Time_2_Set[40]= "28/02/2019 23:59:55";//{'\0'};
00025     
00026     
00027     if(iSetTerminalTime(Time_2_Set))
00028     {
00029         printf("Time Set Success\r\n");
00030     }
00031     Time.start(Print_Date_Time); 
00032     
00033 }
00034