#include <Wire.h>
In your Arduino:
#define SLAVE_ADDRESS 0x29 // e.g. slave address,any number from 0x01 to 0x7F
void setup()
{
Wire.begin(SLAVE_ADDRESS);
}
{
// Then in main body send your data to your PICAXE master
}
OR
#include <Wire.h>
void setup()
{
Wire.begin(2); // join i2c bus with address #2
Wire.onRequest(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
}