[][src]Struct wpilib::dio::DigitalOutput

pub struct DigitalOutput { /* fields omitted */ }

A digital output used to control lights, etc from the RoboRIO.

Methods

impl DigitalOutput
[src]

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

Create a new digital output on the specificed channel, returning an error if initialization fails.

pub fn set_pwm_rate(rate: f64) -> HalResult<()>
[src]

Set the PWM rate for this output, from 0.6Hz to 19kHz. Will return an error if PWM has not been enabled. All digital channels will use the same PWM rate.

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

Set the value to output.

pub fn get(&self) -> HalResult<bool>
[src]

Get the previously-written output.

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

Get the channel for this DIO.

pub fn handle(&self) -> HAL_DigitalHandle
[src]

Get a handle to this DIO.

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

Write a pulse to this output.

pub fn is_pulsing(&self) -> HalResult<bool>
[src]

Is this output currently in the middle of a pulse?

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

Enable PWM for this output.

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

Turn off PWM for this output.

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

Set a new duty cycle to use in PWM on this output.

Trait Implementations

impl Drop for DigitalOutput
[src]

impl Debug for DigitalOutput
[src]

Auto Trait Implementations

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]