This is the Library for creating software I2C Interface. The Library has worked for my UNO (Master) and NANO (Slave) setup.
UNO Master Codes:
#include <SoftwareWire.h>
SoftwareWire myWire(10, 11); //SSDA, SSCL
void setup()
{
Serial.begin(9600);
myWire.begin();
myWire.beginTransmission(0x20);
myWire.write(0x23);
myWire.endTransmission();
}
void loop()
{
}
NANO Slave Codes:
#include<Wire.h>
void setup()
{
Serial.begin(9600);
Wire.begin(0x20);
Wire.onReceive(receiveEvent);
}
void loop()
{
}
void receiveEvent(int howmany)
{
Serial.println(Wire.read(), HEX);
}