erco
Senior Member
I like those Sharp IR distance sensors, even if their analog output is non-linear. I suspect most of us use these either with lookup tables or in non-precision applications where rough ranges are acceptable. But this morning I found some hardcore equations at https://www.upgradeindustries.com/product/58/Sharp-10-80cm-Infrared-Distance-Sensor-(GP2Y0A21YK0F) and https://www.upgradeindustries.com/product/57/Sharp-20-150cm-Infrared-Distance-Sensor-(GP2Y0A02YK0F)
Depending on your ADC resolution and other factors, you might not need floating-point accuracy to 6-7 sig figs.
Depending on your ADC resolution and other factors, you might not need floating-point accuracy to 6-7 sig figs.