arduino as a voltage divider

What's the best way to get between 0 - 5v out of the arduino (has to be kind accurate - need about 129 positions out of it). I want to replace an existing potentiometer.

Thanks,
Joe

I think that is pretty much what analogWrite() attempts to do. (Yes, it' really should be called PWMwrite() but it's supposed to be thought of as the inverse of analogRead(). Add a small Resistor/Capacitor to the pin and you filter out some of the PWM and get a better representation of analog voltage.

If that's not good enough... consider a Digital Potentiometer IC.