I’ve received my Photons today and started a new project. A LiPo battery is connected to a Photon and and also a charging circuit. It expects 5V which I am supplying with a QI Charging receiver. That’s all great and works - I can run the photon off the lipo and also charge the lipo when the qi receiver is on the qi transmitter for charging.
To detect that the system is in charging mode, I put the 5V qi receiver input to the lipo charger through a 10K resistor and then connected it to D0, where I can simply check digitalRead(D0) for charging detection.
I am currently “breathing” - turning slowly on and off a neopixel ring to signal the charging. I know this is not exactly power-saving, so probably charging slower, but that’s OK.
I would like to detect the charge level of the LiPo to let the LEDs breathe faster or slower. Does anyone have a recommendation on how to do that? I assume that I can take the input voltage, connect to a resistor and then read the analog in value. But is there maybe an internal function already that let’s me check the input voltage on VIN?