Arduino writing into Picaxe i2c Slave

Would appreciate guidance from anyone who has code to write from an Arduino into a Picaxe 20x2 slave scratchpad memory.

Specifically I want to write a byte of data into Slave address 0. Using the Arduino Wire library I cannot see how the target address is specified. Must be missing something very simple.
 

nick12ab

Senior Member
On Arduino, the address is specified by the first byte you write to the slave after using Wire.beginTransmission() and then the bytes after that are the data bytes.

Example:
Code:
    [color=#CC6600]Wire[/color].[color=#CC6600]beginTransmission[/color](B1011000);              [color=#7E7E7E]//Initializes i2c transmission to PICAXE[/color]
    [color=#CC6600]Wire[/color].[color=#CC6600]write[/color](x);                                [color=#7E7E7E]//Sets address pointer in the PICAXE to x[/color]
    [color=#CC6600]Wire[/color].[color=#CC6600]write[/color](y);                       [color=#7E7E7E]//Writes y to the PICAXE (at location x)[/color]
    [color=#CC6600]Wire[/color].[color=#CC6600]write[/color](z);                       [color=#7E7E7E]//Writes z to the PICAXE (at location x+1)[/color]
    [color=#CC6600]Wire[/color].[color=#CC6600]endTransmission[/color]();
The number in the Wire.beginTransmission() command is the 7-bit slave address of the PICAXE.
 
Top