And it's not clear for me whether to use pull up resostors or not - I can't understand if my PINS already have it.
Here's some code snippet:
// Master
void I2CMaster::setup()
{
Wire.begin();
}
void I2CMaster::loop()
{
Wire.beginTransmission(100);
Wire.write('c');
byte error = Wire.endTransmission();
_logger->println(error); // always 2!
}
// Slave
void onReceive(int numBytes)
{
// Never called
while(Wire.available() > 0){
int read = Wire.read();
Serial.println(read);
}
}
void setup()
{
Wire.begin(100);
Wire.onReceive(onReceive);
}
Thank you!