Prefer integer division in encoder.py

Co-authored-by: xs5871 <60395129+xs5871@users.noreply.github.com>
This commit is contained in:
Gleb Sabirzyanov 2022-06-26 23:17:49 +10:00 committed by xs5871
parent 1bc54a10a1
commit 58248a9631

View File

@ -64,7 +64,7 @@ class BaseEncoder:
# 1 full step is 4 movements (2 for high-resolution encoder),
# however, when rotated quickly, some steps may be missed.
# This makes it behave more naturally
real_movement = round(self._movement / self.resolution)
real_movement = self._movement // self.resolution
self._pos += self._direction * real_movement
if self.on_move_do is not None:
for i in range(real_movement):