I am trying to use the LM2904P as a voltage buffer. i am using a volt meter at the output, and i get 10v when it should be 2v. This is pretty much what my setup is. - is In1- and + is In1+. i dont know what I'm doing wrong here (or right). I am a mehcnaical engineer and haven't touched electrical since first year. but i cant find anything wrong with my setup.
Your circuit (cleaned up) is not a voltage buffer – for that, the negative feedback is missing:
(your circuit, minus the supply voltage, and minus the avoidable crossings)
Remember that an opamp really just does (idealized, without phase shifts)
Vout = (V⁺ - V⁻)·a
for some large a, e.g. a=10⁵. Your V⁺ - V⁻=2 V, so Vout = 200000, but limited by the supply voltage.
Your circuit is working 100% as expected!
(the negative feedback means that the opamp tries to achieve V+ = V-, and that can only happen with Vout = Vin)
Your opamp has no feedback so it will attempt to operate at its open loop gain. With you putting +2V on the non-inverting input and GND on the inverting input you have a +2V across the inputs and it tries to amplify that 2V times a very high gain and will saturate the output toward the positive rail.
You will not see the output of an LM2904 go all the way to the positive voltage rail because this inexpensive part is not designed as a rail-to-rail output opamp.