Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
refactor: rename rotate_to_position to set_position_target
Browse files Browse the repository at this point in the history
  • Loading branch information
Tropix126 committed Mar 8, 2024
1 parent eda3dd2 commit 5ad9b43
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/pros-devices/src/smart/motor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@ impl Motor {
bail_on!(PROS_ERR, pros_sys::motor_brake(self.port.index() as i8));
},
MotorControl::Velocity(rpm) => unsafe {
bail_on!(
PROS_ERR,
pros_sys::motor_move_velocity(self.port.index() as i8, rpm)
);
bail_on!(
PROS_ERR,
pros_sys::motor_set_brake_mode(
self.port.index() as i8,
pros_sys::E_MOTOR_BRAKE_COAST
)
);
bail_on!(
PROS_ERR,
pros_sys::motor_move_velocity(self.port.index() as i8, rpm)
);
},
MotorControl::Voltage(volts) => {
bail_on!(PROS_ERR, unsafe {
Expand Down Expand Up @@ -168,7 +168,7 @@ impl Motor {
}

/// Sets an absolute position target for the motor to attempt to reach.
pub fn rotate_to_position(
pub fn set_position_target(
&mut self,
position: Position,
velocity: i32,
Expand Down

0 comments on commit 5ad9b43

Please sign in to comment.