Arduino Home Control Timer with PC TimeAutoSync

Good day.

First of all, I would like to thank MEM for the code he provided.

I have modified MEM’s Home Control Daily Timer in preparation for my vacation by trial and error as I am not much into programming. I was able to double the number of alarms so all 4 devices will turn on twice in one day. I also somehow integrated the PC time sync with Processing (I have no RTC) and made it a batch file so it will run at pc startup just in case of power failure.

Here’s the thing, once I upload the code with setTime ( ); close to the actual time/date, then when the autosync runs, I get correct alarm times for my devices. However, when I tried running the arduino without setting the setTime( ); (simulating hours/days of power failure), when the autosync kicks in, it does sync the time but does not give the correct alarm schedules.

Can anybody please see the attached codes and help me correct these? Your help will be appreciated. I am running out of time as I am only counting days before my vacation. I got a bit paranoid after somebody broke in our house last year.

Alarms_Multiple_with_TimeSync.ino (12.7 KB)

AutoSyncArduinoClock.pde (2.22 KB)