http://www.lineameteo.it/viewtopic.php?f=2&t=12889&p=399255#p399255 ----------------------------------- As_Needed Lun 18 Lug, 2016 12:14 Re: Stazione Meteo Completa! (FAI DA TE) ----------------------------------- Ah comunque un altro aggiornamento fatto che mi sono dimenticato di dire, è che la stazione per renderla autonoma il più possibile, ha anche la funzione di cambio da ora solare a legale in modo automatico :D Ho dovuto usare queste due funzioni qui: [code]byte dstOffset (byte d, byte m, unsigned int y, byte h) { /* This function returns the DST offset for the current UTC time. This is valid for the EU, for other places see http://www.webexhibits.org/daylightsaving/i.html Results have been checked for 2012-2030 (but should work since 1996 to 2099) against the following references: - http://www.uniquevisitor.it/magazine/ora-legale-italia.php - http://www.calendario-365.it/ora-legale-orario-invernale.html */ // Day in March that DST starts on, at 1 am byte dstOn = (31 - (5 * y / 4 + 4) % 7); // Day in October that DST ends on, at 2 am byte dstOff = (31 - (5 * y / 4 + 1) % 7); if ((m > 3 && m < 10) || (m == 3 && (d > dstOn || (d == dstOn && h >= 1))) || (m == 10 && (d < dstOff || (d == dstOff && h <= 1)))) return 1; else return 0; } time_t getLocalTime (void) { time_t t = RTC.get (); TimeElements tm; breakTime (t, tm); t += (utcOffset + dstOffset (tm.Day, tm.Month, tm.Year + 1970, tm.Hour)) * SECS_PER_HOUR; return t; } [/code]