[−][src]Struct rust_gpiozero::output_devices::Servo
Represents a PWM-controlled servo motor connected to a GPIO pin.
Methods
impl Servo
[src]
pub fn new(pin: u8) -> Servo
[src]
Returns a Servo with the pin number given with default min_pulse_width
of 1ms,
max_pulse_width
of 2ms and frame_width
of 20ms
pin
- The GPIO pin which the device is attached to
pub fn min(&mut self)
[src]
Set the servo to its minimum position.
pub fn max(&mut self)
[src]
Set the servo to its maximum position.
pub fn mid(&mut self)
[src]
Set the servo to its neutral position.
pub fn set_min_pulse_width(&mut self, value: u64)
[src]
Set the servo's minimum pulse width
pub fn set_max_pulse_width(&mut self, value: u64)
[src]
Set the servo's maximum pulse width
pub fn set_frame_width(&mut self, value: u64)
[src]
Set the servo's frame width(The time between control pulses, measured in milliseconds.)
pub fn get_min_pulse_width(&mut self) -> u64
[src]
Get the servo's minimum pulse width
pub fn get_max_pulse_width(&mut self) -> u64
[src]
Get the servo's maximum pulse width
pub fn get_frame_width(&mut self) -> u64
[src]
Get the servo's frame width(The time between control pulses, measured in milliseconds.)
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,