Quote:
Originally Posted by seg9585
Hmm, I was using the millis() function and did not realize there was a micros() available. Reviewing the Arduino library I now see it is available, so I'll go back and modify my code to use it. This could help to increase heading sample rates.
|
That's what I assumed, do note that micros() returns multiples of 4 (or 8 on 8mhz arduinos).
You might also want to look into using interrupt driven timers.
And while on the topic of timing and arduino, for timing dependent tasks write the code yourself. Tests I did a couple years back showed that there's a SIGNIFICANT overhead for the arduino digitalWrite compared to the comparable C code. I'd always assumed they were just macros but they actually include a fair bit of code.