I am sorry I am not sure about what you say. I am still a newbye.
0x58 in the writing code is actually an example meaning the battery address.
The reading code scan the addresses and when it finds the battery address it shows OK close to the location...I hope I made myself clear. My doubt is not about reading parameters as the code is working properly. I wonder if the following code for writing will actually write the new value in the proper location 0x17.
#include <Wire.h>
#define I2C_ADDRESS 0xB // battery address taken from reading code
#define REG_CURRENT 0x17 // register address
void setup() {
Wire.begin();
delay(100);
byte currentValue = 0x01;
Wire.beginTransmission(I2C_ADDRESS);
Wire.write(CYCLE_COUNT) // (REG_CURRENT);
Wire.write(currentValue);
Wire.endTransmission();
}
void loop() {}