Quote:
Originally Posted by dcb
2. go for more accuracy on the instant display:
|
Why don't you try cli() and sei() routine?
Such as...
Code:
unsigned long microSeconds (void){
unsigned long tmp_timer0_overflow_count;
byte tmp_tcnt0;
cli(); //disable interrupts
tmp_timer0_overflow_count = timer0_overflow_count;
tmp_tcnt0 = TCNT0;
sei(); // enable interrupts
return ((tmp_timer0_overflow_count << 8) + tmp_tcnt0) * 4;
}
Please let me know if the syntax is wrong.
Quote:
Lets hear from y'all. I'm gonna take a few days off in the mean time.
|
Have a nice off.
Yoshi