forked from PaulStoffregen/Time
Update readme
This commit is contained in:
34
Readme.txt
34
Readme.txt
@@ -18,7 +18,7 @@ hour(); // the hour now (0-23)
|
||||
minute(); // the minute now (0-59)
|
||||
second(); // the second now (0-59)
|
||||
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)
|
||||
year(); // the full four digit year: (2009, 2010 etc)
|
||||
|
||||
@@ -44,23 +44,26 @@ following functions eliminates this probglem
|
||||
|
||||
|
||||
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
|
||||
|
||||
timeStatus(); // indicates if time has been set and recently synchronized
|
||||
// returns one of the following enumerations:
|
||||
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
|
||||
timeSet // the time is set and is synced
|
||||
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
|
||||
// returns one of the following enumerations:
|
||||
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
|
||||
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
|
||||
the returned time may have drifted if the status is timeNeedsSync.
|
||||
|
||||
setSyncProvider(getTimeFunction); // set the external time provider
|
||||
setSyncInterval(interval); // set the number of seconds between re-sync
|
||||
setSyncProvider(getTimeFunction); // set the external time provider
|
||||
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.
|
||||
|
||||
@@ -84,7 +87,8 @@ illustrating how the library can be used with various time sources:
|
||||
|
||||
- TimeRTCLog demonstrates how to calculate the difference between times.
|
||||
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.
|
||||
The NTP protocol uses UDP and the UdpBytewise library is required, see:
|
||||
@@ -124,8 +128,8 @@ All the members of the Arduino tm structure are bytes and the year is offset fro
|
||||
Convenience macros provide conversion to and from the Arduino format.
|
||||
|
||||
Low level functions to convert between system time and individual time elements are provided:
|
||||
breakTime( time, &tm); // break time_t into elements stored in tm struct
|
||||
makeTime( &tm); // return time_t from elements stored in tm struct
|
||||
breakTime(time, &tm); // break time_t into elements stored in tm struct
|
||||
makeTime(&tm); // return time_t from elements stored in tm struct
|
||||
|
||||
The DS1307RTC library included in the download provides an example of how a time provider
|
||||
can use the low level functions to interface with the Time library.
|
||||
|
Reference in New Issue
Block a user