Automatic control arduino from cayenne

#24

have a look at this https://www.arduino.cc/en/Reference/WireAvailable

0 Likes

#25

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 c

0 Likes

#26

if 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
}
0 Likes

#27

thank you very much

0 Likes