I've got 2 Arduinos and I want them to communicate with each other over I2C. With using the example code I can send a byte from the slave to the master. Is it possible to send a struct via I2C to the master?
The wire reference says "Wire.send(data, quantity)", but data needs to be the datatype byte. I thought about converting the struct to a array of bytes and send it... but how can I convert the byte array back to a struct?
Bill Porter's site has a library (EasyTransfer) where he shows sending and receiving a structure via a serial link. As serial is also a byte at a time transfer, perhaps you could adapt/convert his code to use I2C?