I have 3 points of concern.
- When a XIAO is connected to a PC USB port, does this mean that a battery will be charged directly by USB 5V? If so, it is dangerous. It is recommended to connect a battery and a XIAO via a Schottky diode.
- Since 3.7V Li-PO battery can be charged up to 4.2V, it is recommended to set R2=33k.
- If a battery voltage drops below about 3.5V, the AD conversion value will be inaccurate.