need help with subroutine

As James C4S said, get rid of the word "float".

Change:

  float distance = 65*pow(volts, -1.10);          // worked out from graph 65 = theretical distance / (1/Volts)S - luckylarry.co.uk

to:

   distance = 65*pow(volts, -1.10);          // worked out from graph 65 = theretical distance / (1/Volts)S - luckylarry.co.uk

You have made two variables called distance the way you did it.