about receiving 2 integer numbers at a time

i want to send two integer values at a time from master to slave while using I2C communication.
i am sending ‘revo’ & ‘count’ from master to slave.
i have used:

Wire.beginTransmission(0x40);
Wire.write(count);
Wire.endTransmission();
delay(500);

Wire.beginTransmission(0x40);
Wire.write(revo);
Wire.endTransmission();
delay(500);

this code:

but i m receiving both numbers assign to single variable.
i actual i need revo as a variable and count as a another variable.
so what can do for that??
please help.

master.ino (2.22 KB)

slave.ino (524 Bytes)

You could receive the first one, copy it to another variable then receive the second one, but how will you know which is which ?

You would be better sending an array of two ints

Wire.write(theArray, numberOfBytesToSend)