I am using a LiPo Fuel Gauge MAX17043 and can read values OK. But in order to reduce the power required I need to set a sleep bit. Registers are 16 bits, how can I write it using the i2c.write?
You just read/write 2 bytes at the register location. I2C registers are only 8 bits.
For the reading it´s fine I just get each byte in separated readings and put it together. But for the writing, if I do 2 bytes (for example write register addr 0X0C, value 0x97 and addr 0X0D, value 0x9C) it do not change the value because was not transmitted all 16 bits at same time. I2C.write does not accept 2 bytes paraameters… any idea?
Have you tried formatting it as in this example?
This format works just perfect! Thanks a lot!!!
I have been looking at this chip too, care to svare the code you got to work? Could save me the trouble when I get that far.
I´m still testing my code, not ready to any public release. When you´re ready and have doubts please send a post