digitalWrite method

void digitalWrite(
  1. int pin,
  2. DigitalValue value
)
inherited

Writes a digital value to a given pin.

Implementation

void digitalWrite(int pin, DigitalValue value) {
  autoWait();
  var error = I2Cexception.empty();
  for (var i = 0; i < retry; ++i) {
    try {
      writeI2Cblock(HatCmd(digitalWriteCmd).getCmdSeqExt(pin, value.index));
      _updateLastAction();
      return;
    } on I2Cexception catch (e) {
      error = e;
      sleep(Duration(milliseconds: delay));
    }
  }
  throw error;
}