slipstick:
As stated on the reference page micros() - Arduino Reference micros() has a resolution of 4 microseconds. So there is no point expecting accuracy better than that.And I'd say that if anything the accuracy is better for slower frequencies. At 200Hz it's reading 0.9984 of the expected value. At 10Hz it's reading 0.9986 of the expected value.
Steve
I know that the micros() has a resolution of 4 microseconds. So I was happy with the results at 200Hz, but after som testing I was curious why the time differs "more" when the frequency is lower.
Maybe I was naive that the result should be around 10us "wrong" when doing two micros() that have a resolution of 4 microseconds. For example I was expecting a result of ~99.990 - 100 ms at 10Hz.
wvmarle:
The clock of the Arduino is not perfectly accurate, that's one error.Your signal is also probably not perfectly accurate, that's another error.
Together they add up indeed - to a whopping 0.15%! Do you really expect even better accuracy than this on anything but carefully calibrated lab equipment?
It's within the requirements, just wondering why. (See above)