Month Timer

Hello everyone. :slight_smile:

I'm a new and I have an idea I do not know how to do it! :~
The idea is a timer programmer, but:
For example, I have

October 2014
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

I would like to run the program speaker every day for 5 seconds only at 13:00 and 19:00. Every day
But if you want to switch it off at a specific day of the month , for example, will not work on 17 and 18 October, but will work in a normaly at 19 and 20 to the end of month.

If it was possible to program it for many months in the same program.

The program will work with the screen showing the time and date. And buttons to adjust the time and date only.
What to do? :stuck_out_tongue:

What to do?

That depends on what you've done so far. How do you know what time it is? Or what date it is?

We will set the time and date by buttons when running, and we will add battery backup to save time!

Whatever method you are using to find out the current date, likely as not it will have a separate field for the day. So surely it's just a matter of saying

if (myTime.day==19)
  {
  doStuff();
 }

and we will add battery backup to save time!

Add battery backup to what?

PaulS:
Add battery backup to what?

for saving time if arduino dont have power.
I dont understand.
What I should to do? from where I will start?
Help me Please! :stuck_out_tongue:

You buy one of these and connect it to your arduino. Then when you read the date you compare the day with the day you want your thing to happen.
http://www.ebay.co.uk/itm/DS1307-I2C-RTC-AT24C32-Real-Time-Clock-Board-Module-Arduino-ARM-PIC-UK-SELLER-/400784468992?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item5d509dac00

I would like to thank you for your cooperation.
But show me that you did not understand my problem.
The problem is mainly in programming.

void loop()
{
RTC.getTime()) 
bool notToday=0;
if((RTC.day<19)&&(RTC.day>16))&&(RTC.month==10))
  notToday=true;
  
bool whatToDo=
   ((RTC.hour==13)||(RTC.hour==19)) &&
   (RTC.minute==0) &&
   (RTC.second<5) && (!notToday));
   
digitalWrite(pinWithSpeakerAttached,whatToDo);
}

KenF:

void loop()

{
RTC.getTime())
bool notToday=0;
if((RTC.day<19)&&(RTC.day>16))&&(RTC.month==10))
  notToday=true;
 
bool whatToDo=
   ((RTC.hour==13)||(RTC.hour==19)) &&
   (RTC.minute==0) &&
   (RTC.second<5) && (!notToday));
   
digitalWrite(pinWithSpeakerAttached,whatToDo);
}

Thanks. I will try it. And tell you :wink: :slight_smile: (y)