Struct ev3dev_lang_rust::sensors::BeaconSeeker
source · pub struct BeaconSeeker { /* private fields */ }Expand description
Seeks EV3 Remote Controller in beacon mode.
Implementations§
source§impl BeaconSeeker
impl BeaconSeeker
sourcepub fn new(sensor: InfraredSensor, channel: u8) -> Ev3Result<BeaconSeeker>
pub fn new(sensor: InfraredSensor, channel: u8) -> Ev3Result<BeaconSeeker>
Wrap a InfraredSensor into a BeaconSeeker
sourcepub fn get_heading(&self) -> Ev3Result<i32>
pub fn get_heading(&self) -> Ev3Result<i32>
Returns heading (-25, 25) to the beacon on the given channel.
sourcepub fn get_distance(&self) -> Ev3Result<i32>
pub fn get_distance(&self) -> Ev3Result<i32>
Returns distance (0, 100) to the beacon on the given channel. Returns -128 when beacon is not found.
sourcepub fn get_heading_and_distance(&self) -> Ev3Result<(i32, i32)>
pub fn get_heading_and_distance(&self) -> Ev3Result<(i32, i32)>
Returns heading and distance to the beacon on the given channel as a tuple.
Trait Implementations§
source§impl Clone for BeaconSeeker
impl Clone for BeaconSeeker
source§fn clone(&self) -> BeaconSeeker
fn clone(&self) -> BeaconSeeker
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for BeaconSeeker
impl Send for BeaconSeeker
impl !Sync for BeaconSeeker
impl Unpin for BeaconSeeker
impl UnwindSafe for BeaconSeeker
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