removed "raw" from motor speed control names
This commit is contained in:
+3
-3
@@ -130,16 +130,16 @@ pub trait Driver {
|
|||||||
/// you need to verify and map properly.
|
/// you need to verify and map properly.
|
||||||
/// 65535 should be the max possible speed, while 0 should be stopped.
|
/// 65535 should be the max possible speed, while 0 should be stopped.
|
||||||
///This is best to not call manually, use set_speed_and_direction_raw instead
|
///This is best to not call manually, use set_speed_and_direction_raw instead
|
||||||
fn set_speed_raw(&mut self, speed: u16);
|
fn set_speed(&mut self, speed: u16);
|
||||||
|
|
||||||
///Commands the motors to use the speed and spin in the same command.
|
///Commands the motors to use the speed and spin in the same command.
|
||||||
///Uses a number between 0 and 65535
|
///Uses a number between 0 and 65535
|
||||||
///This should be used in most cases, unless the motor has the core::logic::motor::controller Trait, then the the methods from that should be used instead.
|
///This should be used in most cases, unless the motor has the core::logic::motor::controller Trait, then the the methods from that should be used instead.
|
||||||
fn set_speed_and_direction_raw(&mut self, speed: u16, dir: Direction) {
|
fn set_speed_and_direction(&mut self, speed: u16, dir: Direction) {
|
||||||
//Set direction before speed, so it won't start spinning in one direction, then snap to the other.
|
//Set direction before speed, so it won't start spinning in one direction, then snap to the other.
|
||||||
//Most MCUs should execute these two lines of code so fast, that it should be neglible regardless.
|
//Most MCUs should execute these two lines of code so fast, that it should be neglible regardless.
|
||||||
self.spin(dir);
|
self.spin(dir);
|
||||||
self.set_speed_raw(speed);
|
self.set_speed(speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user