switch_halTrait OutputSwitch
Source pub trait OutputSwitch {
type Error;
// Required methods
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
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();