From 37fb6745a07d59ba0a5ca7c866b4c3337c7bcc01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathana=C3=ABl=20Restori?= Date: Mon, 10 Sep 2012 17:07:09 +0200 Subject: [PATCH] Remove trailing spaces --- .../WeatherStationWeb/WeatherStationWeb.ino | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arduino/WeatherStationWeb/WeatherStationWeb.ino b/arduino/WeatherStationWeb/WeatherStationWeb.ino index 51d3e44..db1d37f 100644 --- a/arduino/WeatherStationWeb/WeatherStationWeb.ino +++ b/arduino/WeatherStationWeb/WeatherStationWeb.ino @@ -88,14 +88,14 @@ void sendNTPpacket() { packetBuffer[15] = 52; // all NTP fields have been given values, now - // you can send a packet requesting a timestamp: + // you can send a packet requesting a timestamp: Udp.beginPacket(timeserver, 123); //NTP requests are to port 123 Udp.write(packetBuffer,NTP_PACKET_SIZE); Udp.endPacket(); Serial.println("Sending ntp packet"); - - delay(1000); - if ( Udp.parsePacket() ) { + + delay(1000); + if ( Udp.parsePacket() ) { // We've received a packet, read the data from it Udp.read(packetBuffer,NTP_PACKET_SIZE); // read the packet into the buffer @@ -103,15 +103,15 @@ void sendNTPpacket() { // or two words, long. First, esxtract the two words: unsigned long highWord = word(packetBuffer[40], packetBuffer[41]); - unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]); + unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]); // combine the four bytes (two words) into a long integer // this is NTP time (seconds since Jan 1 1900): - unsigned long secsSince1900 = highWord << 16 | lowWord; + unsigned long secsSince1900 = highWord << 16 | lowWord; // Unix time starts on Jan 1 1970. In seconds, that's 2208988800: - const unsigned long seventyYears = 2208988800UL; + const unsigned long seventyYears = 2208988800UL; // subtract seventy years: unsigned long epoch = secsSince1900 - seventyYears + TIMEZONE; - + Serial.println("Adjusting time"); chronodot.adjust(DateTime(epoch)); } @@ -148,7 +148,7 @@ void setup() { tsl.setTiming(TSL2561_INTEGRATIONTIME_13MS); // shortest integration time (bright light) //tsl.setTiming(TSL2561_INTEGRATIONTIME_101MS); // medium integration time (medium light) //tsl.setTiming(TSL2561_INTEGRATIONTIME_402MS); // longest integration time (dim light) - + Udp.begin(8888); sendNTPpacket(); }