The functions that read values from the sensors all take an argument readMode, which specifies the kind of read that will be performed. Several options are defined: <font color="red">QTR_EMITTERS_OFF</font> specifies that the reading should be made without turning on the infrared (IR) emitters, in which case the reading represents ambient light levels near the sensor; <font color="red">QTR_EMITTERS_ON</font> specifies that the emitters should be turned on for the reading, which results in a measure of reflectance; and <font color="red">QTR_EMITTERS_ON_AND_OFF</font> specifies that a reading should be made in both the on and off states. The values returned when the <font color="red">QTR_EMITTERS_ON_AND_OFF</font> option is used are given by '''on + max – off''', where on is the reading with the emitters on, off is the reading with the emitters off, and '''max''' is the maximum sensor reading. This option can reduce the amount of interference from uneven ambient lighting. Note that emitter control will only work if you specify a valid emitter pin in the constructor. | The functions that read values from the sensors all take an argument readMode, which specifies the kind of read that will be performed. Several options are defined: <font color="red">QTR_EMITTERS_OFF</font> specifies that the reading should be made without turning on the infrared (IR) emitters, in which case the reading represents ambient light levels near the sensor; <font color="red">QTR_EMITTERS_ON</font> specifies that the emitters should be turned on for the reading, which results in a measure of reflectance; and <font color="red">QTR_EMITTERS_ON_AND_OFF</font> specifies that a reading should be made in both the on and off states. The values returned when the <font color="red">QTR_EMITTERS_ON_AND_OFF</font> option is used are given by '''on + max – off''', where on is the reading with the emitters on, off is the reading with the emitters off, and '''max''' is the maximum sensor reading. This option can reduce the amount of interference from uneven ambient lighting. Note that emitter control will only work if you specify a valid emitter pin in the constructor. |