pub trait Servo<I: Interface> {
// Required methods
fn set_enable_torque(
&mut self,
interface: &mut I,
enable_torque: bool,
) -> Result<(), Error>;
fn set_position(
&mut self,
interface: &mut I,
value: f32,
) -> Result<(), Error>;
fn get_position(&mut self, interface: &mut I) -> Result<f32, Error>;
}
Expand description
The generic servo trait
Allow using servos without knowing the exact type.
Required Methods§
Sourcefn set_enable_torque(
&mut self,
interface: &mut I,
enable_torque: bool,
) -> Result<(), Error>
fn set_enable_torque( &mut self, interface: &mut I, enable_torque: bool, ) -> Result<(), Error>
Enable/Disable torque on the servo.