Struct rust_gpiozero::input_devices::DigitalInputDevice
[−]
[src]
pub struct DigitalInputDevice { /* fields omitted */ }
Represents a generic input device with typical on/off behaviour. Adds machinery to fire the active and inactive events for devices that operate in a typical digital manner: straight forward on / off states with (reasonably) clean transitions between the two.
Methods
impl DigitalInputDevice
[src]
pub fn new(pin: u64) -> DigitalInputDevice
[src]
Create a new Digital Input Device
Trait Implementations
impl Device for DigitalInputDevice
[src]
gives DigitalInputDevice Device behaviours such as close, is_active, etc
fn pin(&self) -> Pin
[src]
Get the pin
fn value(&self) -> i8
[src]
Returns a value representing the device's state.
fn close(&self)
[src]
Shut down the device and release all associated resources.
fn is_active(&self) -> bool
[src]
Returns True
if the device is currently active and False
otherwise.
impl EventsTrait for DigitalInputDevice
[src]
Give DigitalInputDevice event traits
fn wait_for_active(&self)
[src]
Pause the program until the device is activated
fn wait_for_inactive(&self)
[src]
Pause the program until the device is deactivated