Hi i've got this problem can some out there help please, i'm to write a code for alarm sitting in the project that i'm doing,basically i'm to write a code that will inform some one that its time to take medication, in the morning,afternoon and night, everyday. and the other is to inform someone hourly everyday as well.
#int TIMER1 void TIMER1 isr() { Ticker-=65536; // Decrement ticker by clocks per interrupt if(Ticker<65536) // If second has expired { Ticker+=TIMER1 FREQUENCY; // Increment ticker by clocks per second seconds++; // Increment number of seconds }
//--Optional part start---
if(Seconds==60){Minutes++;Seconds=0; if(Minutes==60){Hours++;Minutes=0; if(Hours==24){Days++;Hours=0; if((Days==29&&Month==2&& !IS LEAP(year)) ||(Days==30&&Month==2) ||(Days == 31&&(Month == 4||Month == 6||Month == 9||Month == 11 ))
||(Days==32) ){Month++;Days=0;} if(Month==13){year++;Month=0;}
}}}
// ---Optional part end--- */
}}
Pick up a generic textbook on C programming.
All code must be inside functions. And for most target platforms, your initial function is main().
Where are your variable declarations?