Converting Analogue input to real value

Take a look at the map() and constrain() functions.
http://arduino.cc/en/Reference/Map