clear variables; alarm = false; stop = false;
Pin=4;                                             % number of Pin of LED
times = [365*86.4e3 31*86.4e3 86.4e3 3600 60 1]';
tstart = clock;
vandaag = tstart(1:3);
morgen = vandaag + [0 0 1];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                    LET OP! vandaag is morgen na 0:00                    %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% fill in your wake up time and wake up interval
twake    = [vandaag  09 35 00]*times;
interval = [0 0 0 0 05 0]*times;    %[Y M D h m s]
tstart = tstart*times;
tpause = max((twake-interval)-tstart,0)
pause(tpause);
disp('start measurements');
tic
while ~alarm
    while toc < 0.1*60
        if clock*times+60 >= twake;
            stop = true;
            break
        end
        pause(5)
    end
    if stop
        break
    end
    tic
    alarm = Complete_script(tstart,twake,interval);
end
Alarm1 = 'Birds-singing-in-the-morning.mp3';
Alarm2 = 'Loud-alarm-clock-sound.wav';
OutputFunc_V3(Pin,Alarm1,Alarm2,twake,times);