User Manual

using the methods in this class.
Constructor: QTRDimmableAnalog(unsigned char* digitalPins, unsigned char numSensors,
unsigned char numSamplesPerSensor = 4, 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: QTRDimmableAnalog(unsigned char* digitalPins, unsigned char numSensors,
unsigned char numSamplesPerSensor, unsigned char oddEmitterPin , unsigned char
evenEmitterPin)
This constructor just calls init(), below, with two emitter pins for controlling two banks separately.
void QTRDimmableAnalog::init(unsigned char* digitalPins, unsigned char numSensors,
unsigned char numSamplesPerSensor = 4, unsigned char emitterPin =
QTR_NO_EMITTER_PIN)
Initializes a QTR-xD-xA or QTRX-xD-xA (analog) sensor array with one emitter pin. This version of
init() works the same as the (non-dimmable) QTRSensorsAnalog version.
void QTRDimmableAnalog::init(unsigned char* digitalPins, unsigned char numSensors,
unsigned char numSamplesPerSensor, unsigned char oddEmitterPin , unsigned char
evenEmitterPin)
Initializes a QTR-xD-xRC or QTRX-xD-xRC (analog) sensor array with two emitter pins for separate
control of the odd and even emitters.
Usage Notes
Calibration
This library allows you to use the calibrate() method to easily calibrate your sensors for the particular
conditions it will encounter. Calibrating your sensors can lead to substantially more reliable sensor
readings, which in turn can help simplify your code since. As such, we recommend you build a
calibration phase into your application’s initialization routine. This can be as simple as a fixed duration
over which you repeated call the calibrate() method. During this calibration phase, you will need to
expose each of your reflectance sensors to the lightest and darkest readings they will encounter. For
example, if you have made a line follower, you will want to slide it across the line during the calibration
phase so the each sensor can get a reading of how dark the line is and how light the ground is. A
sample calibration routine would be:
Arduino Library for the Pololu QTR Reflectance Sensors © 2001–2018 Pololu Corporation
3. QTRSensors Methods & Usage Notes Page 12 of 15