Hey, I am working on a robot and I got the Sharp GP2D12 range sensor and some other sensors. For unity and more presize reading I need to put the analogReference to "INTERNAL2V56" That works perfect for the other sensors because the calculation was linear. I got the range calculation for the GP2D12 from the Playground: http://arduino.cc/playground/Main/ReadGp2d12Range The problem there is I have totally no clue how to change that for 2.56Volts. Could someone help me there please.

This is the calculation but I don't understand what she/he did there.

(6787.0 /((float)tmp - 3.0)) - 4.0;

Would somebody be so kind and explain it to me or even show me how to change it for 2.56V?

Thank you very much, Florian