Added missing resetEncoders() function to encoder_driver.ino

This commit is contained in:
Patrick Goebel 2016-04-18 06:29:00 -07:00
parent 97946646d2
commit d03061ae60
2 changed files with 10 additions and 2 deletions

View File

@ -33,6 +33,12 @@
else return encoders.XAxisReset();
}
/* Wrap the encoder reset function */
void resetEncoders() {
resetEncoder(LEFT);
resetEncoder(RIGHT);
}
#elif defined(ROBOGAIA_3_AXIS)
/* Robogaia 3-axis encoder shield */

View File

@ -100,10 +100,10 @@ class Arduino:
attempts = 1
self.serial_port.write(cmd + '\r')
value = self.serial_port.readline().strip('\n')
while len(value) == 0 and attempts < max_attempts:
print "Command", cmd, "failed", attempts, "time(s)"
self.serial_port.write(cmd + '\r')
value = self.serial_port.readline().strip('\n')
attempts += 1
@ -141,6 +141,8 @@ class Arduino:
return None
def get_encoder_counts(self):
''' Read the current encoder counts
'''
values = self.execute_array('e')
if len(values) != 2: