QTR Rc usage to detect white line on black surface

hello,

i want to use the qtr 8rc sensors to detect a white line on a black surface,
which means the robot has to follow a white line on a black background,
so for this type of line detection how to make the robot calibrate so that it returns a value of say 0 - 1200
once calibrated.

i am using pico board to code this so i want to know whether a function is already written to carry out this task in pololu arduino library

so a snippet of code on how to read a white line and calibrate the sensors to a white line,
would help me a lot

thanks for any help.

Hello.

I moved this thread to the sensors support category since that is a more appropriate place for it.

There is support for reading white lines on a black surface in our Arduino library for QTR Reflectance Sensors, so I suggest reviewing the library’s documentation. You should be able to use the same calibrate() function to calibrate the sensors, then you could use the readLineWhite() function to get the position of a white line.

- Patrick