

#include  <AT89x52.h>
#include <intrins.h> 
#include <math.h>

void Simple_Delay_N_Fifty(int);
void Simple_Delay_Fifty_Milliseconds(void);
void WriteCommandLCD(unsigned char, int);
void speakerRoutine(int dur, int tune);
int IsLeapYear( int y );


sbit RS=P2^4;
sbit EN=P2^5;
sbit speaker = P3^5;


int temp, temp2;
int z; 

void main(void)
{
TMOD |= 0x01;
ET0 = 0;



Simple_Delay_N_Fifty(10);

z = IsLeapYear(2004);
if(z == 1)
{
	WriteCommandLCD(0x20, 1);  //execute command
	WriteCommandLCD(0x0F, 1);  //execute command
}




	while(1)
	{
		speakerRoutine(10,5);
	}


}




int IsLeapYear( int y )
{
         if( ((y % 4) == 0) && ((y % 100) != 0) || ((y % 400) == 0) )
              return( 1 );
         else
              return( 0 );
}



