Wire.endTransmission() return values

this is not documented at the wire library reference Wire - Arduino Reference

Wire.endTransmission(); has different return values

  • 0 .. success
  • 1 .. length to long for buffer
  • 2 .. address send, NACK received
  • 3 .. data send, NACK received
  • 4 .. other twi error (lost bus arbitration, bus error, ..)

according to twi.c