setPwmFrequency method

  1. @override
Future<void> setPwmFrequency(
  1. String pin,
  2. int frequencyHz, {
  3. Map<String, dynamic>? extra,
})
override

Set the PWM frequency in hertz of the given pin of a board.

// Set the PWM frequency of pin 15 to 1600 Hz
await myBoard.setPwmFrequency('15', 1600);

For more information, see Board component.

Implementation

@override
Future<void> setPwmFrequency(String pin, int frequencyHz, {Map<String, dynamic>? extra}) async {
  final request = SetPWMFrequencyRequest()
    ..name = name
    ..pin = pin
    ..frequencyHz = Int64(frequencyHz)
    ..extra = extra?.toStruct() ?? Struct();
  await client.setPWMFrequency(request);
}