DS1307 RTC with Time and TimeAlarms library

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
Franklin97355
 
Posts: 23911
Joined: Mon Apr 21, 2008 2:33 pm

Re: DS1307 RTC with Time and TimeAlarms library

Post by Franklin97355 »

RTC and rtc are two different values. You have no declaration for rtc in your code.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: DS1307 RTC with Time and TimeAlarms library

Post by adafruit_support_rick »

You've declared RTC this way:

Code: Select all

RTC_DS1307 RTC;
That is, as all caps. Capitalization is significant.
You want this:

Code: Select all

time_t syncProvider() {
  return RTC.now().unixtime();
}

User avatar
john_folsom
 
Posts: 8
Joined: Fri May 15, 2015 10:11 am

Re: DS1307 RTC with Time and TimeAlarms library

Post by john_folsom »

well I feel kinda stupid..... Thanks guys, that was exactly the problem!

User avatar
crixus_markus
 
Posts: 7
Joined: Wed Dec 16, 2015 12:56 am

Re: DS1307 RTC with Time and TimeAlarms library

Post by crixus_markus »

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);

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: DS1307 RTC with Time and TimeAlarms library

Post by adafruit_support_rick »


Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”