pinMode method

void pinMode(
  1. int pin,
  2. PinMode mode
)
inherited

Sets the pin mode for a pin.

Implementation

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