setRPM method

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

Spin the Motor indefinitely at the specified speed, in revolutions per minute. If rpm is positive, the motor will spin forwards, and if rpm is negative, the motor will spin backwards.

// Set the motor to turn backwards at 120.5 RPM.
await myMotor.setRPM(-120.5);

For more information, see Motor component.

Implementation

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