pros::v5::Rotation class

Base classes

class Device

Public static functions

static std::vector<Rotation> get_all_devices()
Gets all rotation sensors.

Constructors, destructors, conversion operators

Rotation(const std::int8_t port)
Constructs a new Rotation Sensor object.
Rotation(const Device& device)

Public functions

std::int32_t reset() virtual
Reset the Rotation Sensor.
std::int32_t set_data_rate(std::uint32_t rate) const virtual
Set the Rotation Sensor's refresh interval in milliseconds.
std::int32_t set_position(std::uint32_t position) const virtual
Set the Rotation Sensor position reading to a desired rotation value.
std::int32_t reset_position(void) const virtual
Reset the Rotation Sensor position to 0.
std::int32_t get_position() const virtual
Get the Rotation Sensor's current position in centidegrees.
std::int32_t get_velocity() const virtual
Get the Rotation Sensor's current velocity in centidegrees per second.
std::int32_t get_angle() const virtual
Get the Rotation Sensor's current position in centidegrees.
std::int32_t set_reversed(bool value) const virtual
Set the Rotation Sensor's direction reversed flag.
std::int32_t reverse() const virtual
Reverse the Rotation Sensor's direction.
std::int32_t get_reversed() const virtual
Get the Rotation Sensor's reversed flag.

Friends

std::ostream& operator<<(std::ostream& os, const pros::Rotation& rotation)
This is the overload for the << operator for printing to streams.