Fixed Encoder clear at startup
This commit is contained in:
parent
9e61023e67
commit
3e7df14da8
2 changed files with 11 additions and 4 deletions
|
@ -57,7 +57,12 @@ class Encoder(object):
|
|||
raise IndexError("Invalid encoder port specified!")
|
||||
|
||||
encoder_start_values[port] = Encoder.read_raw(port)
|
||||
|
||||
|
||||
for i in range(1, MOTOR_COUNT + 1):
|
||||
encoder_start_values[i] = Encoder.read_raw(i)
|
||||
@staticmethod
|
||||
def clear_all():
|
||||
"""Reset all encoder positions to 0
|
||||
"""
|
||||
|
||||
for i in range(1, MOTOR_COUNT + 1):
|
||||
encoder_start_values[i] = Encoder.read_raw(i)
|
||||
|
Reference in a new issue