I am working on a Project . I am in a situation where i have to edit code which has no documentation. I am unable to understand a concept which the code claims to be.
// Prototype code
// internal clock running at 10MHZ
#define ERROR1 500 // frequency of the LED flashing on error1 (f=1Hz)
#define ERROR2 100 // frequency of the LED flashing on error2 (f=5Hz)
//To turn on millisec timer assign a value and timer will run for specified amount of time
mtimer failure // declaring failure as a millisectimer .
if (i==1)
failure = ERROR1;
if(i==2)
failure = ERROR2;
if(//failure expires)
{
blink green led;
blink red led;
}
Q1) Why frequency of LED blinking is given 1HZ and 5 HZ repectively.?
Q2) How led is able to blink with those frequencies while the code is executed only after timer is expired..?
q3) what really can happen..??
Thanks in Advance
// Prototype code
// internal clock running at 10MHZ
#define ERROR1 500 // frequency of the LED flashing on error1 (f=1Hz)
#define ERROR2 100 // frequency of the LED flashing on error2 (f=5Hz)
//To turn on millisec timer assign a value and timer will run for specified amount of time
mtimer failure // declaring failure as a millisectimer .
if (i==1)
failure = ERROR1;
if(i==2)
failure = ERROR2;
if(//failure expires)
{
blink green led;
blink red led;
}
Q1) Why frequency of LED blinking is given 1HZ and 5 HZ repectively.?
Q2) How led is able to blink with those frequencies while the code is executed only after timer is expired..?
q3) what really can happen..??
Thanks in Advance