Generate varying voltage from 0 to 5v

I’m trying to generate a true DC voltage that I can vary from 0 to 5v. There are decent methods using an RC circuit but they seem to have drawbacks.

I was wondering if I can use a motor shield and supply a clean 5v DC input and use the Arduino Uno PWM, pin to vary it between any desired voltages between 0 and 5v.

If not, any other suggestions.

Thanks

You need a DAC to truly vary the voltage.

How much current output do you need?

Adafruit has a D to A converter

How do you define 'true' DC voltage ?

You mention PWM as a solution, but that isn't true DC - at least by my definition.

You can filter it - RC circuits - but you mention drawbacks, but I'm not sure if we're talking about the same thing.