WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation

getTimeSinceLastTick

Returns the number of μS between your call to read() and when the last tick was received.
It can be used with a low resolution encoder in conjunction with getDurationOfLastTick() to estimate the fraction of a tick.
Syntax
Encoder. getTimeSinceLastTick()
Where Encoder is the name you have given to the device in Project Designer.
Parameters
None
Returns
TICK_COUNT
Note
This function only returns sensible values if the encoder is using interpolation.
If the encoder has not been rotating for a long time then it may return a strange value. You can guard against this by checking the motor is currently being asked to move or whether it is at a stand still.

 

 

Valid XHTML 1.0 Transitional