guil
Newbie level 3
Hi,
Can somebody explain to me the sample code here -> link.
Particularly in this line:
Why he divide it by 10? I am confused.
And also in this line:
When TMR1H > 0, I am expecting TMR1L = 0xff always, since the timer counts from 0x0000 to 0xffff. Am I right?
thanks in advance.
Ilms
Can somebody explain to me the sample code here -> link.
Particularly in this line:
Code:
for(i = 0 ; i < BUFSIZE ; i++) // for all samples in buffer
{
cm += buf[i] ; // add to sum
}
cm /= BUFSIZE ; // average samples
Why he divide it by 10? I am confused.
And also in this line:
Code:
buf[idx] = TMR1H ; // build a 16 bit value from timer1
buf[idx] <<= 8 ; // MSB
buf[idx] += TMR1L ; // LSB
When TMR1H > 0, I am expecting TMR1L = 0xff always, since the timer counts from 0x0000 to 0xffff. Am I right?
thanks in advance.
Ilms