setGpioState method

  1. @override
Future<void> setGpioState(
  1. String pin,
  2. bool high, {
  3. Map<String, dynamic>? extra,
})
override

Set the high/low state of the given pin of a board.

// Set pin 15 to high
await myBoard.setGpioState('15', true);

For more information, see Board component.

Implementation

@override
Future<void> setGpioState(String pin, bool high, {Map<String, dynamic>? extra}) async {
  final request = SetGPIORequest()
    ..name = name
    ..pin = pin
    ..high = high
    ..extra = extra?.toStruct() ?? Struct();
  await client.setGPIO(request);
}