WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation

read

Read the real time clock and return the values.
The return value may be NULL if the clock is not accessible (ie not plugged in) and so you must always test the returned value in your own code.
Syntax
RTC. read()
Where RTC is the name you have given to the device in Project Designer.
Parameters
None
Returns
DATE_TIME*
Example
Assuming your RTC is called 'myClock' then:
const DATE_TIME* dt = myClock.read();
if(dt != NULL){
uint16_t year = dt->year; // ie 2011
uint8_t month = dt->month; // 1 to 12
uint8_t date = dt->date; // 1 to 31
uint8_t hours = dt->hours; // 0 to 23
uint8_t minutes = dt->minutes; // 0 to 59
uint8_t seconds = dt->seconds; // 0 to 59
}

 

 

Valid XHTML 1.0 Transitional