User Manual

The only other difference you might experience is in the time it takes to read the sensor values. The
QTR-xRC sensors can all be read in parallel, but each requires the timing of a pulse that might take
as long as 3 ms (you can specify how long the library should time this pulse before timing out and
declaring the result full black). The QTR-xA sensors use the analog-to-digital converter (ADC) and
hence must be read sequentially. Additionally, the analog results are produced by internally averaging
a number of samples for each sensor (you can specify the number of samples to average) to decrease
the effect of noise on the results.
Several example sketches are available to help you get started. To view the example sketches, open
the Arduino IDE and navigate to:
File > Examples > QTRSensors
As a first step, we recommend using QTRARawValuesExample (for QTR-xA sensors) or
QTRRCRawValuesExample (for the QTR-xRC sensors). These examples will simply print the raw
readings from the sensors to the serial monitor, using 9600 baud. Once that is working, you might want
to try one of the more advanced examples, QTRAExample or QTRRCExample, which incorporate
calibration and also estimate the position of a line.
Arduino Library for the Pololu QTR Reflectance Sensors © 2001–2018 Pololu Corporation
2. Library Installation Page 5 of 15