Bob B
/
Set_Clock
Set clock using unix time and included functions in mbed.h. Includes link to Unix time converter.
Diff: main.cpp
- Revision:
- 0:680c4f0d8664
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Jul 19 21:30:25 2010 +0000 @@ -0,0 +1,23 @@ +#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); + } +} + +