Struct rust_gpiozero::output_devices::Servo [−][src]
pub struct Servo { /* fields omitted */ }
Represents a PWM-controlled servo motor connected to a GPIO pin.
Implementations
impl Servo
[src]
impl Servo
[src]pub fn new(pin: u8) -> 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 set_min_pulse_width(&mut self, value: u64)
[src]
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]
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]
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]
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]
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]
pub fn get_frame_width(&mut self) -> u64
[src]Get the servo’s frame width(The time between control pulses, measured in milliseconds.)