analogReaderValue method

  1. @override
Future<AnalogValue> analogReaderValue(
  1. String analogReaderName, {
  2. Map<String, dynamic>? extra,
})
override

Read the current value of an analog reader of a board.

// Get the current value of an analog reader named "my_example_analog"
var analogVal = await myBoard.analogReaderValue('my_example_analog');

For more information, see Board component.

Implementation

@override
Future<AnalogValue> analogReaderValue(String analogReaderName, {Map<String, dynamic>? extra}) async {
  final request = ReadAnalogReaderRequest()
    ..boardName = name
    ..analogReaderName = analogReaderName
    ..extra = extra?.toStruct() ?? Struct();
  final response = await client.readAnalogReader(request);
  return response;
}