Time Alarm not trigering

so i set the arduino time with my RTC and i can trigger an event based on the rtc time. but when i try and use the timeAlarm Example with the arduino clock i cant get any thing to trigger.

/*
 * TimeRTCSet.pde
 * example code illustrating Time library with Real Time Clock.
 *
 * RTC clock is set in response to serial port time message 
 * A Processing example sketch to set the time is included in the download
 * On Linux, you can use "date +T%s > /dev/ttyACM0" (UTC time zone)
 */

#include <Time.h>  
#include <Wire.h>  
#include <TimeAlarms.h>
#include <DS1307RTC.h>  // a basic DS1307 library that returns time as a time_t


void setup()  {
  Serial.begin(9600);
     pinMode(8,OUTPUT);
     pinMode(9,OUTPUT);
     digitalWrite(8, HIGH);
     digitalWrite(9, HIGH);
  while (!Serial) ; // Needed for Leonardo only
  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");      
}

void loop()
{
  if (Serial.available()) {
    time_t t = processSyncMessage();
    if (t != 0) {
      RTC.set(t);   // set the RTC and the system time to the received value
      setTime(t);          
    }
  }
  Alarm.alarmRepeat(18,11,30,EveningAlarm);
  //this works VVVVVV from the RTC   
    tmElements_t tm;
    RTC.read(tm);
    
    if(tm.Hour == 18 && tm.Minute == 12)
    {
     EveningAlarm();
     }
     
     
     
    if(tm.Hour == 18 && tm.Minute == 1)
    {
     waterOff();
     }
  // end real time clock timer
  digitalClockDisplay();  
  delay(1000);
  
}

void digitalClockDisplay(){
  // digital clock display of the time
  Serial.print(hour());
  printDigits(minute());
  printDigits(second());
  Serial.print(" ");
  Serial.print(day());
  Serial.print(" ");
  Serial.print(month());
  Serial.print(" ");
  Serial.print(year()); 
  Serial.println(); 
}

void printDigits(int digits){
  // utility function for digital clock display: prints preceding colon and leading 0
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);
}

/*  code to process time sync messages from the serial port   */
#define TIME_HEADER  "T"   // Header tag for serial time sync message

unsigned long processSyncMessage() {
  unsigned long pctime = 0L;
  const unsigned long DEFAULT_TIME = 1357041600; // Jan 1 2013 

  if(Serial.find(TIME_HEADER)) {
     pctime = Serial.parseInt();
     return pctime;
     if( pctime < DEFAULT_TIME) { // check the value is a valid time (greater than Jan 1 2013)
       pctime = 0L; // return 0 to indicate that the time is not valid
     }
  }
  return pctime;
}


void waterOn(){
      digitalWrite(8, LOW);
      digitalWrite(9, LOW);
      Serial.print("water on");
     }
     
void waterOff(){ 
      digitalWrite(8, HIGH);
      digitalWrite(9, HIGH);
   }

void EveningAlarm(){
  Serial.println("Alarm: - turn lights on");  
  digitalWrite(8, LOW);
  digitalWrite(9, LOW);  
}

any idea why this might be happening or how i can get my code to have the "waterOn" and "waterOff" turn on every 3 days or on select days? Thanks

  Alarm.alarmRepeat(18,11,30,EveningAlarm);

How many times do you need to declare this object? What happens to this object when loop ends?

Why do you need the crutches, when you have an RTC?

well at first i was just useing the rtc to trigger the alarms. but when i wanted to code to have the alarm go off on day X and day Y i found the Alarm.alarmRepeat code in the TimeAlarms Library.

if(tm.Hour == 18 && tm.Minute == 12)
    {
     EveningAlarm();
     }
     
     
     
    if(tm.Hour == 18 && tm.Minute == 1)
    {
     waterOff();
     }

if there is a way to have this expanded that would be awsome but i cant think of a way to set it up to have it trigger every 3 days.

let me know if im on the right track with this idea

Daycounter=0;
day=0
if (day != tm.Day)
{
    day = tm.Day
	Daycounter++;
}

If (tm.Hour == 18 && tm.Minute == 1  && Daycounter == 2)
{
     waterOn:
}
If (tm.Hour == 18 && tm.Minute == 10  && Daycounter == 2)
{
     waterOff:
	 Daycounter=0;
}

i think this will work still might be cool to find out a way to say on monday and on tursday but what ever

i think this will work still might be cool to find out a way to say on monday and on tursday but what ever

If the RTC doesn't tell you, one of the functions of the Time library is to tell you which day of the week a particular day is on. So, get the year, month, and day from the RTC, and call that function to get the day of the week. Water on the days you want.

If you want to water every third day, all you need to keep track of is the day you last watered. Then, if today minus then is 3, water again. This is slightly complicated by months having unequal number of days, but it isn't that difficult to determine how many days there are between any given two days.

Cool i got it all working so now it turns on at Sunday and Wednesday

#include <Time.h>  
#include <Wire.h>  
#include <DS1307RTC.h>  // a basic DS1307 library that returns time as a time_t


void setup()  {
  Serial.begin(9600);
     pinMode(8,OUTPUT);
     pinMode(9,OUTPUT);
     digitalWrite(8, HIGH);
     digitalWrite(9, HIGH);
  //while (!Serial) ; // Needed for Leonardo only
  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");      
}

void loop()
{
  if (Serial.available()) {
    time_t t = processSyncMessage();
    if (t != 0) {
      RTC.set(t);   // set the RTC and the system time to the received value
      setTime(t);          
    }
  }
 
  //this works VVVVVV from the RTC   
    tmElements_t tm;
    RTC.read(tm);
    //Serial.print(t);
    Serial.print(weekday());
    if(tm.Hour == 16 && tm.Minute == 32 && (weekday() ==  1 || weekday() == 4)){
     waterOn();
     }
    if(tm.Hour == 16 && tm.Minute == 33 && (weekday() ==  1 || weekday() == 4)){
     waterOff();
     }
  delay(1000);
}
void waterOn(){
      digitalWrite(8, LOW);
      digitalWrite(9, LOW);
     }
     
void waterOff(){ 
      digitalWrite(8, HIGH);
      digitalWrite(9, HIGH);
   }

/*  code to process time sync messages from the serial port   */
#define TIME_HEADER  "T"   // Header tag for serial time sync message

unsigned long processSyncMessage() {
  unsigned long pctime = 0L;
  const unsigned long DEFAULT_TIME = 1357041600; // Jan 1 2013 

  if(Serial.find(TIME_HEADER)) {
     pctime = Serial.parseInt();
     return pctime;
     if( pctime < DEFAULT_TIME) { // check the value is a valid time (greater than Jan 1 2013)
       pctime = 0L; // return 0 to indicate that the time is not valid
     }
  }
  return pctime;
}