Pololu Robotics & Electronics
My account Comments or questions? About Pololu Contact Ordering information Distributors

How do I read the QTRs with read_line_sensors_calibrated?


Hi, I would like to program my Pololu 3pi robot to follow a line. I have a very simple question. void read_line_sensors_calibrated(sensorValues,readMode) is documented as “Returns sensor readings calibrated to a value between 0 and 1000, where 0 corresponds to a reading that is less
than or equal to the minimum value read by calibrate() and 1000 corresponds to a reading that is greater than
or equal to the maximum value. Calibration values are stored separately for each sensor, so that differences in
the sensors are accounted for automatically.”

I have a few questions:
What is the sensorValues parameter?
Where are these values returned, isn’t it a void function?
Does a higher value mean darker or lighter surfaces?

I don’t think you will need my code, so I didn’t post it. If you need to see it, just ask.



I just want to mention for those who are following this discussion that the quoted documentation can be found under the “3pi Robot Functions” section of the Pololu AVR Library Command Reference.

The sensorValues parameter is a pointer to an array of integers that is used by the function to store the values being read from each sensor into the provided array.

As stated in the Pololu 3pi Robot User’s Guide under the “A Simple Line-Following Algorithm for 3pi” section, 0 indicates completely white (or the most reflective) and 2000 for completely black (or least reflective).

- Amanda


Thanks! I like your customer support, it is better than Apple’s support.