#include "mbed.h"
#include "TextLCD.h"
// Host PC Communication channels
Serial pc(USBTX, USBRX); // tx, rx
// I2C Communication
I2C i2c_lcd(PTE0,PTE1); // SDA, SCL
// LCD instantiation
TextLCD_I2C lcd(&i2c_lcd, 0x4E, TextLCD::LCD16x2);
int main() {
Timer t;
time_t seconds = time(NULL);
char buffer[32];
strftime(buffer, 32, "%I:%M %p\n", localtime(&seconds));
lcd.printf(" %s", buffer);
//lcd.printf("Hello World!");
}
Show 12:00 AM actually. Is there any way to initialize time via internet?