LCD clock display set using NTP server

Dependencies:   EthernetNetIf NTPClient_NetServices TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
4180_1
Date:
Sat Apr 14 01:12:23 2012 +0000
Parent:
0:5c5226aac712
Commit message:

Changed in this revision

Internet_LCD_Clock.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 5c5226aac712 -r 09fcc9b81f23 Internet_LCD_Clock.cpp
--- a/Internet_LCD_Clock.cpp	Thu Apr 12 01:44:02 2012 +0000
+++ b/Internet_LCD_Clock.cpp	Sat Apr 14 01:12:23 2012 +0000
@@ -18,19 +18,16 @@
     //Get an Internet IP address using DHCP
     if (ethErr) {
         //error or timeout getting an IP address
-        printf("Error %d in setup.\n\r", ethErr);
         lcd.cls();
         lcd.printf("Network Error \n\r %d",ethErr);
         return -1;
     }
     lcd.cls();
-    ctTime = time(NULL);
     lcd.printf("Reading Time...\n\r");
     //specify time server URL
     Host server(IpAddr(), 123, "0.uk.pool.ntp.org");
     //Read time from server
     ntp.setTime(server);
-    ctTime = time(NULL);
     lcd.printf("Time set");
     //Delay for human time to read LCD display
     wait(1);