add current command to Arduino code

This commit is contained in:
Oskar Weigl
2019-01-03 18:17:12 -08:00
parent 68372a901e
commit 5cd64f2d4f
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -38,6 +38,10 @@ void ODriveArduino::SetVelocity(int motor_number, float velocity, float current_
serial_ << "v " << motor_number << " " << velocity << " " << current_feedforward << "\n";
}
void ODriveArduino::SetCurrent(int motor_number, float current) {
serial_ << "c" << motor_number << " " << current << "\n";
}
float ODriveArduino::readFloat() {
return readString().toFloat();
}
+1
View File
@@ -26,6 +26,7 @@ public:
void SetPosition(int motor_number, float position, float velocity_feedforward, float current_feedforward);
void SetVelocity(int motor_number, float velocity);
void SetVelocity(int motor_number, float velocity, float current_feedforward);
void SetCurrent(int motor_number, float current);
// General params
float readFloat();