arduinoi2c

Arduino I2C single transmission string length limit?


Does anyone know the Arduino I2C single transmission string length limit?

I wrote the code:

char I2C_Send_Char[70];

String OtSTR = "12345678901234567890123456789012345678901234567890123456789" ;
OtSTR.toCharArray(I2C_Send_Char, 70);
Wire.beginTransmission(83);
Wire.write(I2C_Send_Char);
Wire.endTransmission();

However, the received program only displays 32 characters.

12345678901234567890123456789012

Is there something wrong with the settings?


Solution

  • Did you read the documentation?

    The Wire library implementation uses a 32 byte buffer, therefore any communication should be within this limit. Exceeding bytes in a single transmission will just be dropped.