I cant send u entire code, but i send u this sample:
//is my attempt to read
//#define I2C_ADD (0x27) // expander I2C address
unsigned char i2cbyte;
MasterWriteI2C1((I2C_ADD << 1) | 1);
// I do not know if it's the correct address '0x41'
i2cbyte = MasterReadI2C1();
printf("\ni2cbyte: %u\n", i2cbyte); // i want to display value that i read
OBS: I forgot to tell u, but i connected a push button on + IN1, - IN1 of expander and that is what i want to read, if button was pressed or not.
OBS2: Jumpers ( A0, A1, A2 ) of expander board are close.
OBS3: It display value 255, even if button is pressed or not.
P.S. I attached u a link: https://www.ereshop.com/s...e/I2C-IN830M_SHEET.pdf
On page 5/7, Figure7: Addressing, i used address 0x41, i thought that is what i need.