Bob B / Mbed 2 deprecated Set_Clock

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "TextLCD.h"
00003 
00004 
00005 TextLCD lcd(p24, p25, p26, p27, p28, p29, p30); // rs, rw, e, d0, d1, d2, d3
00006 
00007 Serial pc (USBTX,USBRX);
00008 
00009 int main() {
00010 // replace unix time beow with current unix time from http://unixtime-converter.com
00011     set_time(1279538160);
00012 
00013     while (1) {
00014         time_t seconds = time(NULL);
00015         lcd.cls();
00016         printf("\n\rTime Date=\n\r %s", ctime(&seconds));
00017 
00018         lcd.printf("Time %s",ctime(&seconds));
00019         wait(3);
00020     }
00021 }
00022 
00023