I think I need to read up more, I've tried to add a second slave but it receives nothing from both salves
So I went back to basic with one salve
If I use this Wire.begin (SLAVE_ADDRESS_1); only with one slave it works
but if I just use this Wire.begin (); then nothing happens
tried to add this but same nothing comes through
Wire.begin (SLAVE_ADDRESS_1);
Wire.begin (SLAVE_ADDRESS_2);
This is what I've tried
void loop()
{
uint8_t datalen = (sizeof foo) + (sizeof fnum); // get info from the First Slave
Wire.requestFrom (SLAVE_ADDRESS_1, datalen, true);
if (Wire.available() == datalen) { // got correct size of packet
I2C_readAnything (fnum);
I2C_readAnything (foo);
}
Wire.requestFrom (SLAVE_ADDRESS_2, datalen, true);
if (Wire.available() == datalen) { // got correct size of packet
I2C_readAnything (fnum);
I2C_readAnything (foo);
}
if (haveData)
{
Serial.print ("Received 0x58 = ");
Serial.println (fnum);
Serial.print ("Received 0x58 = ");
Serial.println (foo);
Serial.print ("Received 0x59 = ");
Serial.println (fnum);
Serial.print ("Received 0x59 = ");
Serial.println (foo);
haveData = false;
} // end if haveData
} // end of loop
The other thing I'm struggling to understand is how to display the 4 floats are displayed via the serial terminal as there are only one fnum and foo to send.