mirror of
https://github.com/PaulStoffregen/Time.git
synced 2025-08-03 23:44:27 +02:00
Update readme
This commit is contained in:
16
Readme.txt
16
Readme.txt
@@ -18,7 +18,7 @@ hour(); // the hour now (0-23)
|
|||||||
minute(); // the minute now (0-59)
|
minute(); // the minute now (0-59)
|
||||||
second(); // the second now (0-59)
|
second(); // the second now (0-59)
|
||||||
day(); // the day now (1-31)
|
day(); // the day now (1-31)
|
||||||
weekday(); // day of the week, Sunday is day 0
|
weekday(); // day of the week (1-7), Sunday is day 1
|
||||||
month(); // the month now (1-12)
|
month(); // the month now (1-12)
|
||||||
year(); // the full four digit year: (2009, 2010 etc)
|
year(); // the full four digit year: (2009, 2010 etc)
|
||||||
|
|
||||||
@@ -44,15 +44,17 @@ following functions eliminates this probglem
|
|||||||
|
|
||||||
|
|
||||||
Functions for managing the timer services are:
|
Functions for managing the timer services are:
|
||||||
setTime(t); // set the system time to the give time t
|
|
||||||
setTime(hr,min,sec,day,mnth,yr); // alternative to above, yr is 2 or 4 digit yr (2010 or 10 sets year to 2010)
|
|
||||||
adjustTime(adjustment); // adjust system time by adding the adjustment value
|
|
||||||
|
|
||||||
|
setTime(t); // set the system time to the give time t
|
||||||
|
setTime(hr,min,sec,day,mnth,yr); // alternative to above, yr is 2 or 4 digit yr
|
||||||
|
// (2010 or 10 sets year to 2010)
|
||||||
|
adjustTime(adjustment); // adjust system time by adding the adjustment value
|
||||||
timeStatus(); // indicates if time has been set and recently synchronized
|
timeStatus(); // indicates if time has been set and recently synchronized
|
||||||
// returns one of the following enumerations:
|
// returns one of the following enumerations:
|
||||||
timeNotSet // the time has never been set, the clock started at Jan 1 1970
|
timeNotSet // the time has never been set, the clock started at Jan 1 1970
|
||||||
timeNeedsSync // the time had been set but a sync attempt did not succeed
|
timeNeedsSync // the time had been set but a sync attempt did not succeed
|
||||||
timeSet // the time is set and is synced
|
timeSet // the time is set and is synced
|
||||||
|
|
||||||
Time and Date values are not valid if the status is timeNotSet. Otherwise values can be used but
|
Time and Date values are not valid if the status is timeNotSet. Otherwise values can be used but
|
||||||
the returned time may have drifted if the status is timeNeedsSync.
|
the returned time may have drifted if the status is timeNeedsSync.
|
||||||
|
|
||||||
@@ -60,7 +62,8 @@ setSyncProvider(getTimeFunction); // set the external time provider
|
|||||||
setSyncInterval(interval); // set the number of seconds between re-sync
|
setSyncInterval(interval); // set the number of seconds between re-sync
|
||||||
|
|
||||||
|
|
||||||
There are many convenience macros in the time.h file for time constants and conversion of time units.
|
There are many convenience macros in the time.h file for time constants and conversion
|
||||||
|
of time units.
|
||||||
|
|
||||||
To use the library, copy the download to the Library directory.
|
To use the library, copy the download to the Library directory.
|
||||||
|
|
||||||
@@ -84,7 +87,8 @@ illustrating how the library can be used with various time sources:
|
|||||||
|
|
||||||
- TimeRTCLog demonstrates how to calculate the difference between times.
|
- TimeRTCLog demonstrates how to calculate the difference between times.
|
||||||
It is a vary simple logger application that monitors events on digtial pins
|
It is a vary simple logger application that monitors events on digtial pins
|
||||||
and prints (to the serial port) the time of an event and the time period since the previous event.
|
and prints (to the serial port) the time of an event and the time period since
|
||||||
|
the previous event.
|
||||||
|
|
||||||
- TimeNTP uses the Arduino Ethernet shield to access time using the internet NTP time service.
|
- TimeNTP uses the Arduino Ethernet shield to access time using the internet NTP time service.
|
||||||
The NTP protocol uses UDP and the UdpBytewise library is required, see:
|
The NTP protocol uses UDP and the UdpBytewise library is required, see:
|
||||||
|
Reference in New Issue
Block a user