Webbotlib
Cry 'God for Harry, England and St George'. (It's an English thing)
In the section for Sensors/Encoder you state that: "Assuming that the wheel is just rotating continuously then the counter will eventually overflow back to 0 and the frequency of this will depend on how many stripes the encoder has and on how fast the motor is rotating". Your getround is to re-zero the counter before it overflows, this is ok, but what if the counter is at zero and the robot starts moving backwards! Will not the counter need to be able to store -ve numbers?
uint16_t ticks = quad1.encoder.value; (unsigned integer will not show -ve numbers)
Also, unable to find in Webbotavrclib-1.21 value range for the counter, or do I deduce positive integer values from 0 to 65535 from the uint16_t?
or have I missed something
Keep Webbotavrclib rolling it is a fantastic resource.