pub struct LED { /* private fields */ }Expand description
A LED models an LED on the Tessel board.
§Example
use tessel::LED;
let mut led = LED::new("red", "error");
// LEDs are off by default.
assert_eq!(false, led.read());
led.on().unwrap();
assert_eq!(true, led.read());Implementations§
Source§impl LED
impl LED
pub fn new(color: &'static str, kind: &'static str) -> LED
pub fn on(&mut self) -> Result<(), Error>
pub fn off(&mut self) -> Result<(), Error>
pub fn high(&mut self) -> Result<(), Error>
pub fn low(&mut self) -> Result<(), Error>
pub fn toggle(&mut self) -> Result<(), Error>
pub fn read(&self) -> bool
Auto Trait Implementations§
impl Freeze for LED
impl RefUnwindSafe for LED
impl Send for LED
impl Sync for LED
impl Unpin for LED
impl UnwindSafe for LED
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more