Genuino 101 I2C Master Receive - Slave send

Hi guys ,

Im super desperate and this might be the easiest Question ever but.

I need to connect my two Genuino 101 via I2C.
So arduino.cc delivers me two example codes which wont work on my 101.

Master

#include <Wire.h>

void setup()
{
  Wire.begin();        // join i2c bus (address optional for master)
  Serial1.begin(9600);  // start serial for output
}

void loop()
{
  Wire.requestFrom(8, 6,false);    // request 6 bytes from slave device #8

  while (Wire.available())   // slave may send less than requested
  {
    char c = Wire.read(); // receive a byte as character
    Serial1.print(c); // print the character
    Serial1.println();
    
  }

  delay(500);
}

and Slave code is

#include <Wire.h>

void setup() {
  Wire.begin();                // join i2c bus with address #8
  Wire.onReceive(requestEvent); // register event
}

void loop() {
  delay(100);
}

// function that executes whenever data is requested by master
// this function is registered as an event, see setup()
void requestEvent() {
  Wire.write("hello "); // respond with message of 6 bytes
  // as expected by master
}

The Master works fine but the Slave-function not.
My wire.h library doesnt know such functions like requestEvent etc.

exit status 1
‘class TwoWire’ has no member named ‘onReceive’

Do you have any ideas?

Thanks in advance.

I came across this thread trying to find an answer to the same question. It turns out that the Arduino 101 doesn't have I2C slave mode.

Source: https://github.com/01org/corelibs-arduino101/issues/112