have a look at this Wire - Arduino Reference
thank you.I understand it.But the problem here is if not transmitted by array, arduino receives regardless of the signal being.!)
only receive signals cif you want a value to be sent as a single byte then make the following changes:
sender:
CAYENNE_IN(16)
{
int x = getValue.asInt();
Wire.beginTransmission(8); // transmit to device #8
Wire.write(x); // sends one byte
Wire.endTransmission();
}
Reciever:
void receiveEvent(int bytes) {
x = Wire.read(); // read one character from the I2C
Serial.println(x); // print the integer
}
thank you very much