bq34z100 stateofcharge()
用上位机bqStudio软件Advanced Comm发送I2C指令获取stateofcharge():
I2C Address(Hex): AB
Start Register(Hex): 02
Number of Bytes to Read(Decimal): 2
Read
返回的结果是不固定的值,且不等于stateofcharge()的值
返回的结果截图:
TimeStamp , Read/Write , Address , Register , Length , Data ,
2017-07-26 11:42:37 758 , Rd , AB , 02 , 2 , 64 05
2017-07-26 11:42:38 333 , Rd , AB , 02 , 2 , 7F FF
2017-07-26 11:42:39 145 , Rd , AB , 02 , 2 , BE 0A
2017-07-26 11:42:40 003 , Rd , AB , 02 , 2 , 64 06
2017-07-26 11:42:40 690 , Rd , AB , 02 , 2 , 7F FF
2017-07-26 11:42:41 127 , Rd , AB , 02 , 2 , 64 06
2017-07-26 11:42:42 063 , Rd , AB , 02 , 2 , 64 06
2017-07-26 11:42:42 983 , Rd , AB , 02 , 2 , 7F FF
2017-07-26 11:42:43 701 , Rd , AB , 02 , 2 , BE 0A
2017-07-26 11:42:44 467 , Rd , AB , 02 , 2 , Error
I2C 读写的方法是,
start,写地址AA , 0x02, restart, AB , 读2个byte
读取stateofcharge()电量,Advanced comm要怎么填,你是怎么操作的,为什么我读到的值是不固定的错误值
I2C Address(Hex): AA
Start Register(Hex): 02
Number of Bytes to Read(Decimal):1
Read
读出的数据直接就是剩余电量百分比(HEX)
I2C Address(Hex): AA
Start Register(Hex): 02
Number of Bytes to Read(Decimal): 1
Read BUTTON
读取的值就是剩余电量百分比(HEX)