Skip to content

Commit

Permalink
fix char to int conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
madcowswe committed Aug 19, 2018
1 parent 19e3c77 commit e364fc1
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -46,19 +46,20 @@ void loop() {

// Run calibration sequence
if (c == '0' || c == '1') {
int motornum = c-'0';
int requested_state;

requested_state = ODriveArduino::AXIS_STATE_MOTOR_CALIBRATION;
Serial << "Axis" << c << ": Requesting state " << requested_state << '\n';
odrive.run_state(atoi(c), requested_state, true);
odrive.run_state(motornum, requested_state, true);

requested_state = ODriveArduino::AXIS_STATE_ENCODER_OFFSET_CALIBRATION;
Serial << "Axis" << c << ": Requesting state " << requested_state << '\n';
odrive.run_state(atoi(c), requested_state, true);
odrive.run_state(motornum, requested_state, true);

requested_state = ODriveArduino::AXIS_STATE_CLOSED_LOOP_CONTROL;
Serial << "Axis" << c << ": Requesting state " << requested_state << '\n';
odrive.run_state(atoi(c), requested_state, false); // don't wait
odrive.run_state(motornum, requested_state, false); // don't wait
}

// Sinusoidal test move
Expand Down

0 comments on commit e364fc1

Please sign in to comment.