User Manual

The array pins should contain the Arduino analog input pin number for each sensor. For example,
if pins is {0, 1, 7}, sensor 1 is on analog input 0, sensor 2 is on analog input 1, and sensor 3 is on
analog input 7.
numSensors specifies the length of the analogPins array (the number of QTR-A sensors you are
using). numSensors must be no greater than 16.
numSamplesPerSensor indicates the number of 10-bit analog samples to average per channel
(per sensor) for each reading. The total number of analog-to-digital conversions performed will
be equal to numSensors times numSamplesPerSensor. Increasing this parameter increases noise
suppression at the cost of sample rate. This parameter must not exceed 64. Recommended value:
4.
emitterPin is the Arduino digital pin that controls whether the IR LEDs are on or off. This pin is
optional and does not exist on some of the QTR sensor arrays. If a valid pin is specified, the emitters
will only be turned on during a reading. If the value QTR_NO_EMITTER_PIN (255) is used, you can
leave the emitter pin disconnected and the IR emitters will always be on.
Constructor: QTRDimmableRC()
This version of the constructor performs no initialization. If it is used, the user must call init() before
using the methods in this class.
Constructor: QTRDimmableRC(unsigned char* digitalPins, unsigned char numSensors,
unsigned int timeout = 2500, unsigned char emitterPin = QTR_NO_EMITTER_PIN)
This constructor just calls init(), below, with one emitter pin for controlling one bank (or both banks
combined).
Constructor: QTRDimmableRC(unsigned char* digitalPins, unsigned char numSensors,
unsigned int timeout, unsigned char oddEmitterPin, unsigned char evenEmitterPin)
This constructor just calls init(), below, with two emitter pins for controlling two banks separately.
void QTRDimmableRC::init(unsigned char* digitalPins, unsigned char numSensors, unsigned
int timeout = 2500, unsigned char emitterPin = QTR_NO_EMITTER_PIN)
Initializes a QTR-xD-xRC or QTRX-xD-xRC (digital) sensor array with one emitter pin. This version
of init() works the same as the (non-dimmable) QTRSensorsRC version.
void QTRDimmableRC::init(unsigned char* digitalPins, unsigned char numSensors, unsigned
int timeout, unsigned char oddEmitterPin, unsigned char evenEmitterPin)
Initializes a QTR-xD-xRC or QTRX-xD-xRC (digital) sensor array with two emitter pins for separate
control of the odd and even emitters.
Constructor: QTRDimmableAnalog()
This version of the constructor performs no initialization. If it is used, the user must call init() before
Arduino Library for the Pololu QTR Reflectance Sensors © 2001–2018 Pololu Corporation
3. QTRSensors Methods & Usage Notes Page 11 of 15