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;
That is a calculation to correct for the non-linear relationship of distance Vs output voltage of that sensor.
A simple way to cheat is to just divide the analog counts read into raw by 2, then just use the same formula. Otherwise some math wizard around here will have to show you how to change the formula to reflect your change of reference from 5.0 volts (Avcc voltage ref) to your internal 2.56 volt reference.
temp = temp/2;
(6787.0 /((float)tmp - 3.0)) - 4.0;[/quote]
Finally you can also just change the arduino A/D reference back to DEFAULT, read the IR signal and then change it back to INTERNAL2V56. However after changing reference one needs to make a dummy read before you get a good conversion value.