6 years, 6 months ago.  This question has been closed. Reason: Too broad - no single answer

How do you set I2C slave register bits?

Hi,

I'm trying to set bit 0 of register 0x24 in my slave device. With the write function with I2C I can go into its 0x24 register like so,

device.write(deviceI2CAddress, registerAddress, 1);

I tried doing two writes, first get into the register, and then another write with char cmd[0] = 0x01 for registerAddress variable. Of course this just moves me to register 0x01 instead of actually setting the bit I want. I also tried doing

device.write(deviceI2CAddress, cmd, 2); This time with cmd[0] = 0x24, and cmd[1] = 0x01 to get into the register and then next to set bit 0. To see if it worked I read from the address but no change occurred.

How do I actually set bit 0 of my register? Thank you