Replace Potentiometer

yeah so as I turn the dial I change the values of the voltage divider.

Do you think using the arduino with the PWM and a low pass filter is a suitable substitute?