How to use NTP with the Aduino Leonardo
Placed onDS3231 library
The DS3231 library is useful for setting and reading the RTC module.
There are 3 functions we will use in the program to initialise, set and read the RTC-module.
When we initialise the module we want to set the module to not use the special features like interrupts or Alarms. So we initialise it with 0x00.
So to read or write to the module we have to use a struct, the struct consists of the time and the date.
But there is a problem, we get UNIX time back from the NTP request so we have to convert it with the TimeLib library.
The TimeLib library has functions that returns the date and time from the UNIX time, so we pass them into the struct.
The DS3231 module