pub struct RotationSensor { /* private fields */ }
Expand description

A struct which represents a V5 smart port configured as a rotation sensor.

Implementations§

Constructs a new rotation sensor.

Safety

This function is unsafe because it allows the user to create multiple mutable references to the same rotation sensor. You likely want to implement Robot::new() instead.

Reset the current absolute position to be the same as the Rotation Sensor angle.

Set the Rotation sensor to a desired rotation value in centidegrees.

Reset the current absolute position to be the same as the Rotation Sensor angle.

Get the Rotation Sensor’s current position in centidegrees.

Get the Rotation Sensor’s current velocity in centidegrees per second.

Get the Rotation Sensor’s current angle in centidegrees (0-36000).

Set the rotation direction of the sensor.

Reverses the rotational sensor’s direction.

Get the Rotation Sensor’s reversed flag.

Trait Implementations§

The type of data produced by the data source.
The type of errors which could occur while reading data.
Tries to read a new value form the data source.
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.