Hi, we do not have library for all the analog sensors, there are thousand of analog
Even we shrink the sensor to Sharp Infrared distance sensor, there are at least 5 models that I know of, all these sensors have analog output which provide different information at certain voltage. So writing a universal sample code is not possible.
You will need to ready the datasheet of that particular sensor and under the relationship between voltage and distance, further understand the value of ADC function in IFC-AI08, finally, convert the ADC value to distance.
You can try study the
example code of PR23 R2 where we convert the ADC to distance in cm.