position abstract method

Future<double> position({
  1. Map<String, dynamic>? extra,
})

Report the position of the motor based on its encoder. The value returned is the number of revolutions relative to its zero position. This method will raise an exception if position reporting is not supported by the motor.

// Get the current position of an encoded motor.
var position = await myMotor.position();

For more information, see Motor component.

Implementation

Future<double> position({Map<String, dynamic>? extra});