battery method
Sets the battery voltage threshold for the low-battery LED.
Parameters
value : int Battery voltage threshold. Default value is 0.
Value | Voltage Threshold |
---|---|
0 | 3.4 V |
... | ... |
63 | 3.8 V |
Returns
void
Exceptions
DEVICE_NOT_IDLE
: if the device is in acquisition mode.
INVALID_PARAMETER
: if an invalid battery threshold value is given.
Implementation
Future<void> battery({int value = 0}) async {
if (_numChs != 0) SenseException(SenseErrorType.DEVICE_NOT_IDLE);
if (value < 0 || value > 63)
SenseException(SenseErrorType.INVALID_PARAMETER);
final cmd = value << 2;
// <bat threshold> 0 0 - Set battery threshold
await _send(cmd);
}