my slave code
#include <Wire.h>
#include <I2C_Anything.h>
#define SLAVE_ADDRESS 0x1
void setup()
{
Serial.begin(9600);
Wire.begin (SLAVE_ADDRESS);
Wire.onReceive (receiveEvent);
} // end of setup
volatile boolean haveData = false;
volatile float fnum;
volatile long foo;
void loop()
{
} // end of loop
// called by interrupt service routine when incoming data arrives
void receiveEvent (int howMany)
{
if (howMany >= (sizeof fnum) + (sizeof foo))
{
I2C_readAnything (fnum);
I2C_readAnything (foo);
haveData = true;
} // end if have enough data
} // end of receiveEvent
my master code
#include <Wire.h>
#include <I2C_Anything.h>
const byte SLAVE_ADDRESS = 0x1;
void setup()
{
Serial.begin(9600);
Wire.begin ();
} // end of setup
void loop()
{
long foo = 42;
float bar = 123.456;
Wire.beginTransmission (SLAVE_ADDRESS);
I2C_writeAnything (foo);
I2C_writeAnything (bar);
Wire.endTransmission();
} // end of loop
i am using hyperterminal to send the files and the only arduino that receives data is the master.my connection is Masters TX to Slaves TX and Masters RX to Slaves RX. Any recommendations?