[][src]Struct rust_gpiozero::output_devices::Servo

pub struct Servo { /* fields omitted */ }

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

impl Send for Servo

impl !Sync for Servo

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.