[−][src]Struct adafruit_motorkit::dc::DcMotor
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]
pwm: &mut Pca9685<I2cdev>,
motor: Motor
) -> Result<Self, MotorError>
Attempts to initialize a DC motor.
pub fn set_throttle(
&mut self,
pwm: &mut Pca9685<I2cdev>,
throttle: f32
) -> Result<(), MotorError>
[src]
&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].
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,