Struct ev3dev_lang_rust::sensors::CompassSensor [−][src]
pub struct CompassSensor { /* fields omitted */ }HiTechnic EV3 / NXT Compass Sensor.
Implementations
impl CompassSensor[src]
impl CompassSensor[src]pub fn get(port: SensorPort) -> Ev3Result<Self>[src]
Try to get a Self on the given port. Returns None if port is not used or another device is connected.
pub fn find() -> Ev3Result<Self>[src]
Try to find a Self. Only returns a motor if their is exactly one connected, Error::NotFound otherwise.
pub fn list() -> Ev3Result<Vec<Self>>[src]
Extract list of connected ‘Self’
pub const COMMAND_START_CALIBRATION: &'static str[src]
Command for starting the calibration
pub const COMMAND_STOP_CALIBRATION: &'static str[src]
Command for stopping the calibration
pub fn get_rotation(&self) -> Ev3Result<i32>[src]
gets rotation (in degree) from the compass sensor
pub fn set_zero(&mut self) -> Ev3Result<()>[src]
sets the origin
pub fn get_relative_rotation(&self) -> Ev3Result<i32>[src]
calculates the rotation to the origin / the zero point
pub fn start_calibration(&self) -> Ev3Result<()>[src]
calibration: start the calibration by start_calibration() turn the robot 360 degrees end the calibration by stop_calibration() attention: if calibration has not finished, the get_rotation method always returns -258 starts the calibration
pub fn stop_calibration(&self) -> Ev3Result<()>[src]
stops the calibration
Trait Implementations
impl Clone for CompassSensor[src]
impl Clone for CompassSensor[src]fn clone(&self) -> CompassSensor[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Device for CompassSensor[src]
impl Device for CompassSensor[src]fn get_attribute(&self, name: &str) -> Attribute[src]
fn get_address(&self) -> Ev3Result<String>[src]
fn set_command(&self, command: &str) -> Ev3Result<()>[src]
fn get_commands(&self) -> Ev3Result<Vec<String>>[src]
fn get_driver_name(&self) -> Ev3Result<String>[src]
impl Sensor for CompassSensor[src]
impl Sensor for CompassSensor[src]fn get_bin_data(&self) -> Ev3Result<String>[src]
fn get_bin_data_format(&self) -> Ev3Result<String>[src]
fn get_decimals(&self) -> Ev3Result<i32>[src]
fn get_fw_version(&self) -> Ev3Result<String>[src]
fn get_mode(&self) -> Ev3Result<String>[src]
fn set_mode(&self, mode: &str) -> Ev3Result<()>[src]
fn get_modes(&self) -> Ev3Result<Vec<String>>[src]
fn get_num_values(&self) -> Ev3Result<i32>[src]
fn get_poll_ms(&self) -> Ev3Result<i32>[src]
fn set_poll_ms(&self, poll_ms: i32) -> Ev3Result<()>[src]
fn get_units(&self) -> Ev3Result<String>[src]
fn get_value(&self, index: u8) -> Ev3Result<i32>[src]
fn get_value0(&self) -> Ev3Result<i32>[src]
fn get_value1(&self) -> Ev3Result<i32>[src]
fn get_value2(&self) -> Ev3Result<i32>[src]
fn get_value3(&self) -> Ev3Result<i32>[src]
fn get_value4(&self) -> Ev3Result<i32>[src]
fn get_value5(&self) -> Ev3Result<i32>[src]
fn get_value6(&self) -> Ev3Result<i32>[src]
fn get_value7(&self) -> Ev3Result<i32>[src]
fn get_text_value(&self) -> Ev3Result<String>[src]
Auto Trait Implementations
impl !RefUnwindSafe for CompassSensor
impl !RefUnwindSafe for CompassSensorimpl Send for CompassSensor
impl Send for CompassSensorimpl !Sync for CompassSensor
impl !Sync for CompassSensorimpl Unpin for CompassSensor
impl Unpin for CompassSensorimpl UnwindSafe for CompassSensor
impl UnwindSafe for CompassSensor