Thank you for your reply. It helps me to better understanding.
As you noted the code is not mine, I would have liked to know how to do it.
Reading smart battery docs and the running the code, the 0x17 address is the cycle_count, so this seems to be ok. I donot know the reason not using wire library and I would be be able to rewrite te sketch. Are there adavntages using wire instead of I2C?