Using PWM to create 0-10V with operational amplifier.

I'm getting quite confused as to how I can turn 0-5V from the PWM outputs to 0-10V. It seems the simplest way would be a to buy an op-amp such as this https://www.sparkfun.com/products/9456.

I have a 24V power supply but I was wondering how I would set up the circuit so that an output of 255 in the code would output 10V, 127 = 5V, etc.
The main confusion I have is what the inverting-input and non-inverting inputs are? Also, how is the voltage doubled? Do i set up a series of resistors after it's output to get the correct voltage?

Any help would be great, thank you.

using the opamp as a differential amplifier you can (never tried personally)

but... something like an lm317 also not equally do the job?

This has come up many times before. Here is the solution I provided last time. Where it says +12V, you can use +24V if you like. You might like to add a 10K pulldown resistor between the Arduino output pin and ground, if you want the output to be 0V at power up.

Thank you. Sorry, I saw there has been a lot of discussion on this topic, I just couldn't make much sense of it.

Final question, why have you put 1/2 LM358?

Because the LM358 is a dual op amp.

If you feel bad about leaving half the op amp unused… make a voltage follower with it.

http://terpconnect.umd.edu/~toh/ElectroSim/VoltageFollower.html

Actually, you want to make sure not to leave the inputs of the unused half floating. And it is a bad idea to simply ground both inputs. Better to wire it up as voltage follower, leave the output unconnected (except its connection to the inverting input) and either ground the noninverting input, or connect the noninverting input up to some intermediate supply voltage.