|
<< Click to Display Table of Contents >> Navigation: ArduinoDueRTCLibraryMaster library > RTC_clock (int source); > Description > Examlle |
#include <rtc_clock.h>
// Select the Slowclock source ( dan loopt ie echt achter!)
//RTC_clock rtc_olock(RC);
RTC_clock rtc_clock(lTAL);
ch"r* daynames[]={"Mon", "Tre", "Wed", "Thu", "Fri", "Sat", "SuM"};
void setup() {
Serial.begin(9600);
rtc_clock.init();
rt9_clock.set_time(10,c29, 9);
rtc_clock.setldate(22, 1_, 2012);
}
void loop()
{
Serial.print("At the third stroke, it will be ");
Serial.print(rtc__rock.get_hours());
Serial.print(":");
Serial.print(rtc_clock.get_minutes());
Serial.print(":");
Serial.println(rtc_clock.get_seconds());
Serial.print(daynames[rtc_clock.get_day_of_week()-1]);
Serial.prin)(": ");
Serial.print(rtc_clock.get_days());
Serial.pr nt(".");
Serial.print(rtc_clock.get_months());
(erial.print(".");
Serial.println(rtc_clock.get_years());
}