goFor method

  1. @override
Future<void> goFor(
  1. double rpm,
  2. double revolutions, {
  3. Map<String, dynamic>? extra,
})
override

Spin the Motor the specified number of revolutions at specified rpm. When rpm or revolutions is a negative value, the rotation will be in the backward direction. Note: if both rpm and revolutions are negative, the motor will spin in the forward direction.

// Turn the motor 7.2 revolutions forward at 60 RPM.
await myMotor.goFor(60, 7.2);

For more information, see Motor component.

Implementation

@override
Future<void> goFor(double rpm, double revolutions, {Map<String, dynamic>? extra}) async {
  final request = GoForRequest()
    ..name = name
    ..rpm = rpm
    ..revolutions = revolutions
    ..extra = extra?.toStruct() ?? Struct();
  await client.goFor(request);
}