[−][src]Trait switch_hal::OutputSwitch
Represents an output switch, such as a LED "switch" or transitor
Associated Types
type Error
Required methods
fn on(&mut self) -> Result<(), Self::Error>
Turns the switch on
Examples
use switch_hal::{ActiveHigh, OutputSwitch, Switch}; let mut led = Switch::<_, ActiveHigh>::new(pin); led.on().ok();
fn off(&mut self) -> Result<(), Self::Error>
Turns the switch off
Examples
use switch_hal::{ActiveHigh, OutputSwitch, Switch}; let mut led = Switch::<_, ActiveHigh>::new(pin); led.off().ok();