Trait switch_hal::OutputSwitch[][src]

pub trait OutputSwitch {
    type Error;
    fn on(&mut self) -> Result<(), Self::Error>;
fn off(&mut self) -> Result<(), Self::Error>; }
Expand description

Represents an output switch, such as a LED “switch” or transitor

Associated Types

Required methods

Turns the switch on

Examples

use switch_hal::{OutputSwitch, Switch, IntoSwitch};
let mut led = pin.into_active_high_switch();
led.on().ok();

Turns the switch off

Examples

use switch_hal::{OutputSwitch, Switch, IntoSwitch};
let mut led = pin.into_active_high_switch();
led.off().ok();

Implementors