There are digital potentiometers on the market, which have variable resistance adjustable by a digital pulse from a microprocessor. If you take a variable voltage regulator, like the LM317, its output voltage is set by the ratio of two resistors. Using a digital potentiometer for one of the resistors gives you a voltage regulator controlled by an Arduino.
I built a lab power supply this way, with voltage adjustable from 1.5 to 28 volts, in 0.025v. steps. I also built into it a battery charger, by monitoring current (voltage drop through a resistor), and bumping the voltage up and down to get the required current flow.
It works very well for the battery types I'm charging, but you should be sure you understand the complete charging cycle for your batteries before you start. Also, getting to two amps will take a voltage regulator enhanced by a bypass power transistor. Lots of circuits like that out on the internet.