DS1307 RTC with Time and TimeAlarms library
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Franklin97355
- Posts: 23911
- Joined: Mon Apr 21, 2008 2:33 pm
Re: DS1307 RTC with Time and TimeAlarms library
RTC and rtc are two different values. You have no declaration for rtc in your code.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: DS1307 RTC with Time and TimeAlarms library
You've declared RTC this way:
That is, as all caps. Capitalization is significant.
You want this:
Code: Select all
RTC_DS1307 RTC;
You want this:
Code: Select all
time_t syncProvider() {
return RTC.now().unixtime();
}
- john_folsom
- Posts: 8
- Joined: Fri May 15, 2015 10:11 am
Re: DS1307 RTC with Time and TimeAlarms library
well I feel kinda stupid..... Thanks guys, that was exactly the problem!
- crixus_markus
- Posts: 7
- Joined: Wed Dec 16, 2015 12:56 am
Re: DS1307 RTC with Time and TimeAlarms library
hey... sir I'm making a project title interactive digital clock.,once you call time, it will response the current time.. same as the date, temperature and the alarm.. my problem is, in setting the alarm. i want to set a value particularly on the hourStart1 and minuteStart1.. through a for-loop function...? any advices ?
time_t newStart1 = AlarmHMS (hourStart1, minuteStart1, 0);
Alarm1 = Alarm.alarmRepeat(newStart1, alarmTone);
time_t newStart1 = AlarmHMS (hourStart1, minuteStart1, 0);
Alarm1 = Alarm.alarmRepeat(newStart1, alarmTone);
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: DS1307 RTC with Time and TimeAlarms library
Use the Time Alarms library:
https://www.pjrc.com/teensy/td_libs_TimeAlarms.html
https://www.pjrc.com/teensy/td_libs_TimeAlarms.html
Please be positive and constructive with your questions and comments.