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(){
  // RTC setup
  rtc.begin(DateTime(F(__DATE__), F(__TIME__)));
  // motor setup
  pinMode (motorPin1, OUTPUT) ;
  pinMode (motorPin2, OUTPUT) ;
  pinMode (motorPin3, OUTPUT) ;


void loop(){

void startComposition()
  Alarm.timerRepeat(10, buzz1);
  Alarm.timerRepeat(3, buzz2);
  Alarm.timerRepeat(7, buzz3);

void stopComposition()

void buzz1(){
void buzz2(){
void buzz3(){
void hit(const int motor)
  digitalWrite (motor, HIGH) ;
  delay(1000) ;
  digitalWrite (motor, LOW) ;

void digitalClockDisplay(){
  // digital clock display of the time
    //printing the current time
  DateTime now =;

  Serial.print(' ');
  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

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.