I guess the easiest solution might be a digital potentiometer? It takes a voltage input which controls the passive potentiometer.

Using an Analog Voltage to Control a Digital Potentiometer - Application Note - Maxim