Set clock using unix time and included functions in mbed.h. Includes link to Unix time converter.

Dependencies:   mbed

main.cpp

Committer:
rumbleweed
Date:
2010-07-19
Revision:
0:680c4f0d8664

File content as of revision 0:680c4f0d8664:

#include "mbed.h"
#include "TextLCD.h"


TextLCD lcd(p24, p25, p26, p27, p28, p29, p30); // rs, rw, e, d0, d1, d2, d3

Serial pc (USBTX,USBRX);

int main() {
// replace unix time beow with current unix time from http://unixtime-converter.com
    set_time(1279538160);

    while (1) {
        time_t seconds = time(NULL);
        lcd.cls();
        printf("\n\rTime Date=\n\r %s", ctime(&seconds));

        lcd.printf("Time %s",ctime(&seconds));
        wait(3);
    }
}