losaplaces.blogg.se

Arduino wire library repeated start
Arduino wire library repeated start







arduino wire library repeated start

I’m sure its simple but beyond me at the moment. I’m thinking I need to take the returned “registerValue” and convert the HEX to a string of 1’s and 0’s? I’m not sure what I should change in my current unsigned int wire request code that is working fine for other registers that are not returning data in HEX format. The next register returns the same Hex data type but instead of 2 Bytes it returns 4 + 1 Bytes. The 0 or 1 status of those bits will tell me whats up based on this graph:

arduino wire library repeated start

Now I’m thinking that I need to convert that HEX value to string of 16 individual bits. Now I want to read from this register that returns a 2 Byte Hex value held in a unsigned Int data format. Those work fine for pulling data from registers that only hold and return 1 or 2 Bytes of signed & unsigned int data. Wire.requestFrom(BQ20Z45_Address,2,true) Wire.requestFrom(BQ20Z45_Address,1,true) My current sketch is using the following 3 functions to read registers over the Wire library on a Arduino Micro and its working perfectly.I’ll try to be as clear as I can, so lets start off with the first task I need help with. I have a working library that is successfully communicating with the battery management chip over i2c and I’m pulling most of the info I need but there are more registers I need help with accessing.

arduino wire library repeated start

I’m needing some help understanding how to communicate with a battery management system via i2c.









Arduino wire library repeated start