writeAnalog method

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

Write analog value to pin.

// Set pin 11 to value 48
await myBoard.writeAnalog('11', 48);

For more information, see Board component.

Implementation

@override
Future<void> writeAnalog(String pin, int value, {Map<String, dynamic>? extra}) async {
  final request = WriteAnalogRequest()
    ..name = name
    ..pin = pin
    ..value = value
    ..extra = extra?.toStruct() ?? Struct();
  await client.writeAnalog(request);
}