Struct adafruit_motorkit::dc::DcMotor
source · [−]pub struct DcMotor { /* private fields */ }
Expand description
A structure to initialize and control a DC motor.
Implementations
sourceimpl DcMotor
impl DcMotor
sourcepub fn try_new(
pwm: &mut Pca9685<I2cdev>,
motor: Motor
) -> Result<Self, MotorError>
pub fn try_new(
pwm: &mut Pca9685<I2cdev>,
motor: Motor
) -> Result<Self, MotorError>
Attempts to initialize a DC motor.
sourcepub fn set_throttle(
&mut self,
pwm: &mut Pca9685<I2cdev>,
throttle: f32
) -> Result<(), MotorError>
pub fn set_throttle(
&mut self,
pwm: &mut Pca9685<I2cdev>,
throttle: f32
) -> Result<(), MotorError>
Sets the throttle for the motor. Valid throttle values are in the range [-1.0, 1.0].
Auto Trait Implementations
impl RefUnwindSafe for DcMotor
impl Send for DcMotor
impl Sync for DcMotor
impl Unpin for DcMotor
impl UnwindSafe for DcMotor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more