Software for qtr-8a

QRT-8rc operates in the form of high-low (1-0). QTR-8A provides analog output. therefore, it is necessary to calibrate the C language in an array. Is there a library available for Pic ?
As software, I try to get the highest and lowest values in memory, but how should I do this?

void kalibrasyon(){

for(int16 y=0;y<1000;y++){ int8 i;
                           
                           set_adc_channel (23);  delay_us(10);   i=read_adc();
                           
                           if(i<dizi[0]) { dizi[0]=i; }
                           if(i>dizi[1]) { dizi[1]=i; }
                          
                           delay_ms(1);
                         }

Hello.

I moved your post to our Sensors subforum, which seemed more appropriate.

We do not have any code examples for reading our QTR reflectance sensors from a PIC microcontroller. From your description, it sounds like you are trying to calibrate your sensors by finding the minimum and maximum values for each sensor. If so, you might find it helpful to look at the calibrating functions in our Arduino library for the QTR sensors and try porting the code to the PIC.

By the way, the QTR-xRC sensors do not just output a digital high or low signal. The digital I/O lines controlling each sensor on the sensor array must be driven high to charge the on-board circuit for at least 10 us and then set as an input so that the I/O line can measure the discharge time. You can find more information on how the sensors work in the QTR-xRC section of the QTR Reflectance Sensor Application Note.

- Amanda

Miss Amanda, thank you for answering my question. I had a look at the arduino library and it was hard to understand because it was written professionally, so I couldn’t translate it into C. I’ll follow your form with the hope that you will have a work for the Pic microcontroller. have a nice day.