Trying to start a function on certain time using RTC

Hi guys,

I am trying to start a function (startComposition) at the certain time but it just wont happen. However rtc works fine and prints time correctly. Maybe someone know how to solve this ?

#include <Wire.h>
#include <RTClib.h>
#include "Time.h"
#include "TimeAlarms.h"

const int motorPin1 = 3;
const int motorPin2 = 4;
const int motorPin3 = 5;

RTC_Millis rtc; 


void setup(){
  
  Wire.begin();
  // RTC setup
  rtc.begin(DateTime(F(__DATE__), F(__TIME__)));
  
  
  
  // motor setup
  pinMode (motorPin1, OUTPUT) ;
  pinMode (motorPin2, OUTPUT) ;
  pinMode (motorPin3, OUTPUT) ;
  
  Alarm.alarmRepeat(17,23,0,startComposition);

  Serial.begin(9600);
}

void loop(){
  digitalClockDisplay();
  delay(1000);
  //Alarm.delay(1000);
}

void startComposition()
{
  Serial.print('START');
  Alarm.timerRepeat(10, buzz1);
  Alarm.timerRepeat(3, buzz2);
  Alarm.timerRepeat(7, buzz3);
}

void stopComposition()
{
}

void buzz1(){
  hit(motorPin1);
}
void buzz2(){
  hit(motorPin2);
}
void buzz3(){
  hit(motorPin3);
}
void hit(const int motor)
{    
  digitalWrite (motor, HIGH) ;
  delay(1000) ;
  digitalWrite (motor, LOW) ;
  delay(100);
}

void digitalClockDisplay(){
  // digital clock display of the time
  //Serial.print(hour());
  //printDigits(minute());
  //printDigits(second());
  //Serial.println(); 
  
    //printing the current time
  DateTime now = rtc.now();

  Serial.print(now.year());
  Serial.print('/');
  Serial.print(now.month());
  Serial.print('/');
  Serial.print(now.day());
  Serial.print(' ');
  Serial.print(now.hour());
  Serial.print(':');
  Serial.print(now.minute());
  Serial.print(':');
  Serial.print(now.second());
  Serial.println();
  Alarm.delay(1000); // wait one second between clock display
}

//void printDigits(int digits){
//  Serial.print(":");
//  if(digits < 10)
//  Serial.print('0');
//  Serial.print(digits);
//}

It looks like Alarm.delay is required to service the alarms. Try uncommenting it.

Yeah, i uncommented it but it does not change anything

hdxn:
Yeah, i uncommented it but it does not change anything

What is the time on the RTC (it should be the date and time the code was compiled) and what time is the alarm due to trigger ?

Time on RTC is 2017/5/12 19:2:30 , and the time that i want to trigger motors due right now is just few minutes ahead, since i just want to make a test to make sure if it works or not.

If you know what time it is, and you spend most of your time doing nothing (delay(1000)), why do you need the TimeAlarms library?

On every pass through loop(), see if it is time to do something. If so, do it. If not, Alarm.delay(1), and loop again.

Setting up three more timers in startComposition() doesn't make sense.