analogWrite method

void analogWrite(
  1. int pin,
  2. int value
)
inherited

Writes an analog value to a pin.

Implementation

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