Hey guys,
I jumpered SJ7 and am reading the A1 pin to get the charging status. Ideally, I would just get a 0 or 1 to let me know it was charging. When using analogread, I get a value somewhere between 0 and 800. 0 when no light and some number higher when there is light. However, it doesn’t appear to be linear. If I could know how to correctly read this signal to match when LED2 was on, that would be great. I started poking around the docs on the charging chip status, but it looks like I will have a small learning curve. If you guys could assist, it would be greatly appreciated. Thinking I may need a resistor or two for a simple digital signal? Thanks in advance…
I was just checking as the charge status feature (SJ7 -> A1) was added in Rev.3.
Anyway, to use an analog pin for digital IO, you do need to set the pin mode on the SAMD platform. I believe this might have been unnecessary on the AVR platform.
Note, the charge indicator, LED2 will also light up when the battery is charging. If LED2 is off, you will receive a LOW reading.
Here is a test sketch, change the pin as required: