Struct ev3dev_lang_rust::sensors::GyroSensor [−][src]
pub struct GyroSensor { /* fields omitted */ }
Expand description
LEGO EV3 gyro sensor.
Implementations
Try to get a Self
on the given port. Returns None
if port is not used or another device is connected.
Try to find a Self
. Only returns a motor if their is exactly one connected, Error::NotFound
otherwise.
Angle
Angle
Angle
Rotational Speed
Rotational Speed
Rotational Speed
Raw sensor value ???
Raw sensor value ???
Raw sensor value ???
Angle and Rotational Speed
Angle and Rotational Speed
Angle and Rotational Speed
Calibration ???
Calibration ???
Calibration ???
Rotational Speed (2nd axis)
Rotational Speed (2nd axis)
Rotational Speed (2nd axis)
Angle (2nd axis)
Angle (2nd axis)
Angle (2nd axis)
Gets the angle, ranging from -32768 to 32767 Fails if it has been set in the wrong mode
Gets the rotational speed value, ranging from -440 to 440 Fails is it has been set in the wrong mode: for example, fails if we ask for rotational speed while in MODE_GYRO_ANG mode
Trait Implementations
Returns the attribute wrapper for an attribute name.
Returns the name of the port that the motor is connected to.
Sends a command to the device controller.
Returns a space separated list of commands that are supported by the device controller.
Returns the name of the driver that provides this device.
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
Returns the format of the values in bin_data
for the current mode. Possible values are:
Returns the number of decimal places for the values in the value<N>
attributes of the current mode.
Returns the firmware version of the sensor if available. Currently only NXT/I2C sensors support this. Read more
Returns the current mode. See the individual sensor documentation for a description of the modes available for each type of sensor. Read more
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
Returns the number of value<N>
attributes that will return a valid value for the current mode.
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
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
Returns the units of the measured value for the current mode. May return empty string if units are unknown.
Returns the current value{index}
value if available.
Returns the current value0
value if available.
Returns the current value1
value if available.
Returns the current value2
value if available.
Returns the current value3
value if available.
Returns the current value4
value if available.
Returns the current value5
value if available.
Returns the current value6
value if available.
Returns the current value7
value if available.
Returns a space delimited string representing sensor-specific text values. Returns -EOPNOTSUPP
if a sensor does not support text values.
Auto Trait Implementations
impl !RefUnwindSafe for GyroSensor
impl Send for GyroSensor
impl !Sync for GyroSensor
impl Unpin for GyroSensor
impl UnwindSafe for GyroSensor
Blanket Implementations
Mutably borrows from an owned value. Read more