How to process i2c information

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
ttadam
Posts: 18
Joined: Sun Apr 26, 2020 3:36 pm

How to process i2c information

Post by ttadam » Fri Jun 18, 2021 12:50 pm

hello there,
I need some help with I2C, it is the first time when I need to use a device without a library.
The device is a fuel gauge. MAX17055. I am using micropython ofc.
i2c.readfrom(104, 0x06) this command should give me the battery level.
what I get is this (each line is a reading, takean after eachother):
b'\x13^o\x01\x16B'
b'\xc1@\x1a\x00\xb1\x11'
b'\n\x03\x85e\x8d('
b'\xdc\x12:\x00#&'
My guestion is how should I understood this data?
Looks off to me. Why do I get completly different data after each reading?
Thanks in advance! :)

User avatar
karfas
Posts: 193
Joined: Sat Jan 16, 2021 12:53 pm
Location: Vienna, Austria

Re: How to process i2c information

Post by karfas » Sat Jun 19, 2021 1:19 pm

ttadam wrote:
Fri Jun 18, 2021 12:50 pm
i2c.readfrom(104, 0x06) this command should give me the battery level.
Are you sure your i2c bus is working well ?
According to one of the arduino drivers, the i2c address of a MAX17055 is 0x36 (this is NOT 104 decimal), see https://github.com/AwotG/Arduino-MAX170 ... 5_Driver.h
A few hours of debugging might save you from minutes of reading the documentation! :D
My repositories: https://github.com/karfas

Post Reply