See also follow-up question about i2c addresses
I have this mikroe board wired up to an S2 Feather via the SDA
and SCL
pins. The Mikroe board is powered by the Feather via 3v3
and GND
. I have 2k pullup resistors to 3v3
on the SDA
and SCL
pins.
Having run and I2C scan, I returned the following two addresses: 0x53
and 0x5b
on the Mikroe board. At this point, feel free to have a look at the datasheet.
I want to read the EEPROM, so I have tried:
result = bytearray(8)
i2c.writeto_then_readfrom(0x5b, result, result)
print(result)
this returns:
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00)
So then I think I need to send the address of the EEPROM read command to the mikroe board, which is listed as 0x01
in the datasheet. I try to load various commands from the datasheet into my writeto_then_readfrom_function
such as 0x01
and 0xe5
(simple system status) in various ways.
I have tried to append the address to the buffer using:
result = bytearray.append(0x01)
But that returns
TypeError: argument has wrong type
So I tried to load it in as a byte, thinking that surely a bytearray can contain bytes:
test = bytes(0xe5)
result = bytearray.append(test)
But, sure enough, I have the same error. So how to I actually send the appropriate command to the Mikroe board so it transmits the data back to the buffer? Perhaps this isn't even the appropriate method? As an aside I have tried all of the examples above using the other address, 0x53
as well.