Struct deoxy::Motor [] [src]

pub struct Motor { /* fields omitted */ }

A Motor represents a hardware motor.

Motors are given all the necessary configuration information to manage their own position and communication and provide a high-level interface to accomplish related tasks.

Methods

impl Motor
[src]

[src]

Constructs a new motor on the given pin which has the given period.

range takes the format (minimum, maximum).

[src]

The minimum usable pulse width, as specified upon creation.

Examples

use std::time::Duration;
use deoxy::Motor;
let motor = Motor::new(0, Duration::from_millis(20), (Duration::new(0, 900_000), Duration::new(0, 1_200_000)));
assert_eq!(motor.min(), Duration::new(0, 900_000));

[src]

The maximum usable pulse width, as specified upon creation.

Examples

use std::time::Duration;
use deoxy::Motor;
let motor = Motor::new(0, Duration::from_millis(20), (Duration::new(0, 900_000), Duration::new(0, 1_200_000)));
assert_eq!(motor.max(), Duration::new(0, 1_200_000));

[src]

Sets the pulse width to the center of the possible range, bringing it to the neutral position.

[src]

Attempts to set the pulse width to the given duration.