[][src]Struct adafruit_motorkit::dc::DcMotor

pub struct DcMotor { /* fields omitted */ }

A structure to initialize and control a DC motor.

Methods

impl DcMotor[src]

pub fn try_new(
    pwm: &mut Pca9685<I2cdev>,
    motor: Motor
) -> Result<Self, MotorError>
[src]

Attempts to initialize a DC motor.

pub fn set_throttle(
    &mut self,
    pwm: &mut Pca9685<I2cdev>,
    throttle: f32
) -> Result<(), MotorError>
[src]

Sets the throttle for the motor. Valid throttle values are in the range [-1.0, 1.0].

pub fn stop(&mut self, pwm: &mut Pca9685<I2cdev>) -> Result<(), MotorError>[src]

Stops energizing the PWMs for this motor.

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.