[][src]Struct wpilib::pwm::PWM

pub struct PWM { /* fields omitted */ }

Methods

impl PWM
[src]

pub fn new(channel: i32) -> HalResult<Self>
[src]

pub fn set_raw(&mut self, value: i32) -> HalResult<()>
[src]

Set the PWM value directly to the hardware.

pub fn raw(&self) -> HalResult<i32>
[src]

Get the PWM value directly from the hardware.

pub fn set_position(&mut self, pos: f64) -> HalResult<()>
[src]

Set the PWM value based on a position. pos must be between 0 and 1.

pub fn position(&self) -> HalResult<f64>
[src]

Get the PWM value in terms of a position.

pub fn set_speed(&mut self, speed: f64) -> HalResult<()>
[src]

Set the PWM value based on a speed between -1 and 1.

pub fn speed(&self) -> HalResult<f64>
[src]

Get the PWM value in terms of speed.

pub fn set_disabled(&mut self) -> HalResult<()>
[src]

Temporarily disables the PWM output. The next set call will re-enable.

pub fn set_period_multiplier(&mut self, mult: PeriodMultiplier) -> HalResult<()>
[src]

Slow down the PWM signal for old devices.

pub fn set_zero_latch(&mut self) -> HalResult<()>
[src]

Honestly, I have no idea what this does and it isn't documented in wpilib.

pub fn enable_deadband_elimination(
    &mut self,
    eliminate_deadband: bool
) -> HalResult<()>
[src]

Optionally eliminate the deadband from a speed controller.

pub fn set_bounds(
    &mut self,
    max: f64,
    deadband_max: f64,
    center: f64,
    deadband_min: f64,
    min: f64
) -> HalResult<()>
[src]

Set the bounds on the PWM pulse widths. This sets the bounds on the PWM values for a particular type of controller. The values determine the upper and lower speeds as well as the deadband bracket.

pub fn set_raw_bounds(
    &mut self,
    max: i32,
    deadband_max: i32,
    center: i32,
    deadband_min: i32,
    min: i32
) -> HalResult<()>
[src]

Set the bounds on the PWM values. This sets the bounds on the PWM values for a particular each type of controller. The values determine the upper and lower speeds as well as the deadband bracket.

pub fn raw_bounds(
    &self,
    max: &mut i32,
    deadband_max: &mut i32,
    center: &mut i32,
    deadband_min: &mut i32,
    min: &mut i32
) -> HalResult<()>
[src]

Get the bounds on the PWM values. This Gets the bounds on the PWM values for a particular each type of controller. The values determine the upper and lower speeds as well as the deadband bracket.

pub fn channel(&self) -> i32
[src]

Get the channel of this device.

Trait Implementations

impl Drop for PWM
[src]

impl Debug for PWM
[src]

Auto Trait Implementations

impl Send for PWM

impl Sync for PWM

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
    T: From<U>, 
[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> 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.

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