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 duplicate 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 !Freeze for BeaconSeeker
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more