Why do you want to do that ?
I hope you are not trying to use the I2C bus to send data to a Raspberry Pi for example.
There is a function that tells how many free spots are available: Wire.availableForWrite().
The basic Arduino boards have a buffer of 32 bytes.
Most newer boards (such as the MKR Zero) have a buffer of 256 bytes.
It is possible to change the library and make it 256 bytes, but then you have to do that every time that you update the Arduino IDE.
You could also copy the files of the Wire library into your project, but then you don't get the bug fixes with a new version of the Arduino IDE.
You might also run into memory problems, because there is not a single buffer, but a few.
Look for the define for the buffer length, they are here and here. Please don't change them
One solution would to create your own buffer. Then modify your read loop every say 16 bytes and move them into your buffer. This is much simpler and easier to maintain.
Why do you want to have a buffer of 256?
You code shows you try to send 1+1+256 = 258 bytes.
if you check the links from Koepel you will see that the library internally initializes a RX and a TX buffer with the same #define. So if you rise the buffer from 32 (*2) to 258(?) * 2 you will block 452 additional memory.
Do you believe your code will be stable with this add on?
i think so too.
but, i can't to edit library code.
can you teach me? i supposed to change the "uint8" code...
but, i change the code... all situation appear error... T.T
Hi, Koepel,
Sorry i late reply your question.
i test to write data in EEPROM.
i2c write process is "Slave Addres + Data", but i test "Slave Address + Data1 + Data2 + ... + DataN".
that process is more reduce the time to same clock speed.
and i want to know to arduino limits.
i test 255(Address High&LOW&Data253) is good, but i setting to more is error.
so i find solution.
Why not?
There is a variable that holds the number of bytes in the buffer. This even on the master library ( have you got that then ) you have to change this variable to an int ( a 16 bit one).
Dear Mike,
i back up wire.h and test change the code.
but at that firmware compile, continue error.
if you guide to me that 16bit, but that's error.
so i don't know how edit wire.h file.