There are two lines(+ and - cable lines) between the board and the Lipo battery. I cut one of these(+ or -) and put a switch in between. It was a very simple works. Can’t we do this?
there is no need for the switch. The board has an MCP73831 LIPO charger that controls charging ( or not). I have no idea why a switch would have an impact unless the resistance is too high even when closed.
However, if I add the switch on the Lipo battary line(cabel), it will not charge. I wonder why.
And if I can control the board to charge or not-charge with SW code, I don’t need to add the physical switch.
So I asked you for a detailed example.
I understood you to be saying “the board supports charging so you don’t need to do any other devices or control”.
However, I want to control charging or not-charging while USB-C is connected to the board, either through a ‘HW switch on the battery side’ or ‘S/W CODE’.
Normally the LIPO MCP73831-controller will detect that the LIPO has been fully charged to the right level and as such the charging will switch off and LED (connected to the STATE pin) will switch off. If your closed switch has zero resistance (which a switch should have) this will work the same way. If the LIPO is charged and you remove the USB-C connector the battery/LIPO will take over automatically. No switch needed.