Proper handling of encoder rollover math

Proper handling of encoder rollover math:

#arduino