I'm building a portable speaker using a PAM8403 amp, 3.7v battery, and a battery charging module, all powered by USB input. What I want to do is be able to switch between
1) charging the battery from USB input
2) Power amp just from 3.7v battery.
3) power amp just from USB input(So when it is plugged into the wall it runs 5v. to the amp and gives it more power than when running off the battery).
I can't figure out how to do this without using switch for the battery, the power input, and to turn it all on and off. so many switches would be very user friendly. Is there a way to do this with less switches?