D-314 / IP2368-Arduino-Library

An Arduino library for interfacing with the IP236x IC. Provides functionalities for reading and managing charging states, battery percentage, and more.
MIT License
18 stars 1 forks source link

Posting trash data when no chip connected #2

Closed daskalovst closed 1 week ago

daskalovst commented 5 months ago

Battery Percentage [%]: 255 Battery Voltage [mV]: 65535 1 1 1 Unknown Charge State

it needs to have some check is it connected before starts sending requests

D-314 commented 5 months ago

It looks like a communication error. The function returns a value in any case, even if the request is unsuccessful. In the specific example, 0xFF (255) is returned as an error code, and 0xFFFF (65535), as two two bytes received with an error or not received at all.