pub struct Arduino(/* private fields */);
Expand description
A handle on an Arduino, for communicating with it via the Firmata protocol.
Implementations§
Source§impl Arduino
impl Arduino
Sourcepub fn new() -> Result<Arduino, Error>
pub fn new() -> Result<Arduino, Error>
Creates an Arduino object from the single currently connected Arduino device.
§Errors
This function calls arduino::cli::query
, and will pass along any errors produced by it.
Sourcepub fn digital_write(&mut self, pin: Pin, state: State)
pub fn digital_write(&mut self, pin: Pin, state: State)
Writes the given pin state to the given pin of the Arduino.
Sourcepub fn analog_write(&mut self, pin: Pin, level: Level)
pub fn analog_write(&mut self, pin: Pin, level: Level)
Writes the given pin level to the given pin of the Arduino.
Sourcepub fn set_pin_mode(&mut self, pin: Pin, mode: Mode)
pub fn set_pin_mode(&mut self, pin: Pin, mode: Mode)
Set the given pin of the Arduino to the given mode.
Auto Trait Implementations§
impl Freeze for Arduino
impl RefUnwindSafe for Arduino
impl Send for Arduino
impl Sync for Arduino
impl Unpin for Arduino
impl UnwindSafe for Arduino
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