[−][src]Struct ev3dev_lang_rust::gyro_sensor::GyroSensor
Methods
impl GyroSensor
[src]
pub fn new(port: SensorPort) -> Option<GyroSensor>
[src]
Try to get a GyroSensor
on the given port. Returns None
if port is not used or another device is connected.
pub fn find() -> Option<GyroSensor>
[src]
Try to find a GyroSensor
. Only returns a sensor if their is exactly one connected, None
otherwise.
pub fn set_mode_col_ang(&mut self) -> AttributeResult<()>
[src]
pub fn set_mode_col_rate(&mut self) -> AttributeResult<()>
[src]
pub fn set_mode_col_fas(&mut self) -> AttributeResult<()>
[src]
pub fn set_mode_gyro_g_and_a(&mut self) -> AttributeResult<()>
[src]
pub fn set_mode_gyro_cal(&mut self) -> AttributeResult<()>
[src]
Trait Implementations
impl Device for GyroSensor
[src]
fn get_attribute(&mut self, name: &str) -> &Attribute
[src]
fn get_address(&mut self) -> AttributeResult<String>
[src]
Returns the name of the port that the motor is connected to.
fn set_command(&mut self, command: String) -> AttributeResult<()>
[src]
Sends a command to the device controller.
fn get_commands(&mut self) -> AttributeResult<Vec<String>>
[src]
Returns a space separated list of commands that are supported by the device controller.
fn get_driver_name(&mut self) -> AttributeResult<String>
[src]
Returns the name of the driver that provides this device.
impl Sensor for GyroSensor
[src]
fn get_bin_data(&mut self) -> AttributeResult<String>
[src]
Reading the file will give the unscaled raw values in the value<N>
attributes. Use bin_data_format
, num_values
and the individual sensor documentation to determine how to interpret the data. Read more
fn get_bin_data_format(&mut self) -> AttributeResult<String>
[src]
Returns the format of the values in bin_data
for the current mode. Possible values are:
fn get_decimals(&mut self) -> AttributeResult<isize>
[src]
Returns the number of decimal places for the values in the value<N>
attributes of the current mode.
fn get_fw_version(&mut self) -> AttributeResult<String>
[src]
Returns the firmware version of the sensor if available. Currently only NXT/I2C sensors support this. Read more
fn get_mode(&mut self) -> AttributeResult<String>
[src]
Returns the current mode. See the individual sensor documentation for a description of the modes available for each type of sensor. Read more
fn set_mode(&mut self, mode: String) -> AttributeResult<()>
[src]
Sets the sensor to that mode. See the individual sensor documentation for a description of the modes available for each type of sensor. Read more
fn get_modes(&mut self) -> AttributeResult<Vec<String>>
[src]
Returns a list of the valid modes for the sensor.
fn get_num_values(&mut self) -> AttributeResult<isize>
[src]
Returns the number of value<N>
attributes that will return a valid value for the current mode.
fn get_poll_ms(&mut self) -> AttributeResult<isize>
[src]
Returns the polling period of the sensor in milliseconds. Returns -EOPNOTSUPP
if changing polling is not supported. Note: Setting poll_ms too high can cause the input port autodetection to fail. If this happens, use the mode attribute of the port to force the port to nxt-i2c mode
. Values must not be negative. Read more
fn set_poll_ms(&mut self, poll_ms: isize) -> AttributeResult<()>
[src]
Sets the polling period of the sensor in milliseconds. Setting to 0 disables polling. Note: Setting poll_ms too high can cause the input port autodetection to fail. If this happens, use the mode attribute of the port to force the port to nxt-i2c mode
. Values must not be negative. Read more
fn get_units(&mut self) -> AttributeResult<String>
[src]
Returns the units of the measured value for the current mode. May return empty string if units are unknown.
fn get_value0(&mut self) -> AttributeResult<isize>
[src]
fn get_value1(&mut self) -> AttributeResult<isize>
[src]
fn get_value2(&mut self) -> AttributeResult<isize>
[src]
fn get_value3(&mut self) -> AttributeResult<isize>
[src]
fn get_value4(&mut self) -> AttributeResult<isize>
[src]
fn get_value5(&mut self) -> AttributeResult<isize>
[src]
fn get_value6(&mut self) -> AttributeResult<isize>
[src]
fn get_value7(&mut self) -> AttributeResult<isize>
[src]
fn get_text_value(&mut self) -> AttributeResult<String>
[src]
Returns a space delimited string representing sensor-specific text values. Returns -EOPNOTSUPP
if a sensor does not support text values.
Auto Trait Implementations
impl Send for GyroSensor
impl Sync for GyroSensor
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,