Hello. How to convert data from Sharp IR gp2y0a41sk0f-4-30 to centimeters ?I use this code:
numberOfSensors 2
int ir1 = A1;
void setup() {
Serial.begin(38400);
}
void loop() {
float volts = analogRead(ir1)0.0032226;
float distance = 12.3pow(volts, -1.10);
Serial.print(distance);
delay(250);
}
But i have error by 2cm. I try change coefficient 12,3 but the error is the same .