Skip to main content Link Menu Expand (external link) Document Search Copy Copied

double position(rotationUnits units)

Returns the position of the encoder in the specified units

Parameters

  • units - The units to return the position in

Example

rotation rot = rotation(PORT1);
Encoder enc = Encoder(rot);
enc.position(rotationUnits::deg); // returns the position of the encoder in degrees