programming

I want to turn the LED on and off by using the RTC (DS1307) and the alarm function. Here is the code and the portion that is highlighter it`s what i think is the problem.

#include “Wire.h”
#include <Time.h>
#include <TimeAlarms.h>
#include <DS1307RTC.h> // a basic DS1307 library that returns time as a time_t
int ledPin = 02; // LED connected to digital pin 2
void setup()
{
byte second, minute, hour;
Wire.begin();
Serial.begin(57600);
pinMode(ledPin, OUTPUT);
setSyncProvider(RTC.get); // the function to get the time from the RTC
if(timeStatus()!= timeSet)
Serial.println(“Unable to sync with the RTC”);
else
Serial.println(“RTC has set the system time”);
Alarm.alarmRepeat(0,05,20, IlluminationOn); // 8:30am every day
Alarm.alarmRepeat(0,15,20,IlluminationOff); // 5:45pm every day
}
void loop()
{
Alarm.delay(1000); // service the alarm timers once per second
}
void IlluminationOn()
{
digitalWrite(ledPin, HIGH); // set the LED on
}
void IlluminationOff()
{
digitalWrite(ledPin, LOW); // set the LED off
}

I don't see any highlighting. Do you have pullup resisters on your I2C lines (SCL, SDA)?

Your LED, you have pin2 to LED anode, cathode to current limit resister to ground?

This part runs continuously after setup:

void  loop()
{
  Alarm.delay(1000); // service the alarm timers once per second
}

I am not familiar with the libraries you called - that will call out these somehow?

Alarm.alarmRepeat(0,05,20, IlluminationOn);  // 8:30am every day
Alarm.alarmRepeat(0,15,20,IlluminationOff);  // 5:45pm every day

Thank you for your reply, i am using the arduino mega which contains the pins for the connection SDA and SCL with no need for pull up resistors according to an article I read. I run the code to see if it the RTc has the set time, but it keeps giving me the same results even if the RTC is or it is not connected. I believe there could be a problem with the Library or this Part of the Code.

setSyncProvider(RTC.get);   // the function to get the time from the RTC

This part of the code is to be used with the TimeAlarms library found in the Arduino website .My group is trying to use the RTC for continous reading time to be use for an alarm to turn on and off a component. In our case an led for now.

Alarm.alarmRepeat(0,05,20, IlluminationOn);  // 8:30am every day
Alarm.alarmRepeat(0,15,20,IlluminationOff);  // 5:45pm every day

Thank You