How can I convert the analog readings obtained form my 5v sensor (https://www.pololu.com/product/2474) to distance in cm? The code I have tried is posted below. I need the conversion code for both 3v and 5v sensor voltage input just for the 5v sensor model. Thanks!
[code] float sensorValue = analogRead(sensor);
sensorValue = map(sensorValue, 124, 670, 670, 124);
float voltage = sensorValue * (3.3/1024);
float factor = 5.5;
float distance = pow(voltage, factor);