Hi Folks,
I'm trying to get 2 M5Stack Atom's to talk together via I2C, or more specifcially, SoftI2C in Micropython.
I've flashed both devices with Micropython 1.18 and have code on device A that looks like:
import machine
i2c = machine.SoftI2C(scl=machine.Pin(26), sda=machine.Pin(32), freq=400000, timeout=50000)
data = i2c.readfrom_mem(2, 1, 10)
print(data.decode('utf-8'), end="")
Then on device B, I have the code to send data:
import machine
i2c = machine.SoftI2C(scl=machine.Pin(26), sda=machine.Pin(32), freq=400000, timeout=50000)
i2c.writeto_mem(2, 1, bytearray("Hello World"))
Nothing seems to come through, I have tried i2c.scan()
however it just returns and empty list on both.
I realise these are not hardware I2C pins, but they are for the Grove cable I'm using to power the second Atom.
If anyone has any examples/reference/docs or general tips, that would be great.