Gets readings from the five down-facing line sensors on the front sensor array.
More...
#include <Zumo32U4LineSensors.h>
|
| Zumo32U4LineSensors () |
| Minimal constructor. More...
|
|
| Zumo32U4LineSensors (uint8_t *pins, uint8_t numSensors, uint8_t emitterPin=SENSOR_LEDON) |
| Constructor that takes pin arguments. More...
|
|
void | initThreeSensors (uint8_t emitterPin=SENSOR_LEDON) |
| Configures this object to use just three line sensors. More...
|
|
void | initFiveSensors (uint8_t emitterPin=SENSOR_LEDON) |
| Configures this object to use all five line sensors. More...
|
|
void | init (uint8_t *pins, uint8_t numSensors, uint16_t timeout=2000, uint8_t emitterPin=SENSOR_LEDON) |
| Configures this object to use a custom set of pins. More...
|
|
void | init (unsigned char *pins, unsigned char numSensors, unsigned int timeout=2000, unsigned char emitterPin=QTR_NO_EMITTER_PIN) |
|
void | read (unsigned int *sensor_values, unsigned char readMode=QTR_EMITTERS_ON) |
|
void | emittersOff () |
|
void | emittersOn () |
|
void | calibrate (unsigned char readMode=QTR_EMITTERS_ON) |
|
void | resetCalibration () |
|
void | readCalibrated (unsigned int *sensor_values, unsigned char readMode=QTR_EMITTERS_ON) |
|
int | readLine (unsigned int *sensor_values, unsigned char readMode=QTR_EMITTERS_ON, unsigned char white_line=0) |
|
|
void | init (unsigned char *pins, unsigned char numSensors, unsigned char emitterPin) |
|
Gets readings from the five down-facing line sensors on the front sensor array.
The functions that this class inherits from QTRSensorsRC, such as read() and calibrate(), are documented in the user's guide for the QTRSensors library. QTRSensors is a separate Arduino library with a separate GitHub repository, but we include a copy of it in the Zumo32U4 library since it is needed for the Zumo32U4LineSensors class.
Definition at line 43 of file Zumo32U4LineSensors.h.
◆ Zumo32U4LineSensors() [1/2]
Zumo32U4LineSensors::Zumo32U4LineSensors |
( |
| ) |
|
|
inline |
◆ Zumo32U4LineSensors() [2/2]
Zumo32U4LineSensors::Zumo32U4LineSensors |
( |
uint8_t * |
pins, |
|
|
uint8_t |
numSensors, |
|
|
uint8_t |
emitterPin = SENSOR_LEDON |
|
) |
| |
|
inline |
Constructor that takes pin arguments.
This constructor calls init() with the specified arguments.
Definition at line 58 of file Zumo32U4LineSensors.h.
◆ calibrate()
void QTRSensors::calibrate |
( |
unsigned char |
readMode = QTR_EMITTERS_ON | ) |
|
|
inherited |
◆ emittersOff()
void QTRSensors::emittersOff |
( |
| ) |
|
|
inherited |
◆ emittersOn()
void QTRSensors::emittersOn |
( |
| ) |
|
|
inherited |
◆ init() [1/3]
void Zumo32U4LineSensors::init |
( |
uint8_t * |
pins, |
|
|
uint8_t |
numSensors, |
|
|
uint16_t |
timeout = 2000 , |
|
|
uint8_t |
emitterPin = SENSOR_LEDON |
|
) |
| |
|
inline |
Configures this object to use a custom set of pins.
- Parameters
-
pins | A pointer to an array with the pin numbers for the sensors. |
numSensors | The number of sensors. |
timeout | Specifies the length of time in microseconds beyond which you consider the sensor reading completely black. |
emitterPin | The number of the pin that controls the emitters for the line sensors. You can specify a value of QTR_NO_EMITTER_PIN for this parameter if you want this object to not do anything to the emitters. |
Definition at line 97 of file Zumo32U4LineSensors.h.
◆ init() [2/3]
void QTRSensors::init |
( |
unsigned char * |
pins, |
|
|
unsigned char |
numSensors, |
|
|
unsigned char |
emitterPin |
|
) |
| |
|
protectedinherited |
◆ init() [3/3]
void QTRSensorsRC::init |
( |
unsigned char * |
pins, |
|
|
unsigned char |
numSensors, |
|
|
unsigned int |
timeout = 2000 , |
|
|
unsigned char |
emitterPin = QTR_NO_EMITTER_PIN |
|
) |
| |
|
inherited |
◆ initFiveSensors()
void Zumo32U4LineSensors::initFiveSensors |
( |
uint8_t |
emitterPin = SENSOR_LEDON | ) |
|
|
inline |
Configures this object to use all five line sensors.
This function configures this object to use all five line sensors.
For this configuration to work, jumpers on the front sensor array must be installed in order to connect pin 20 to DN2 and connect pin 4 to DN4.
Definition at line 80 of file Zumo32U4LineSensors.h.
◆ initThreeSensors()
void Zumo32U4LineSensors::initThreeSensors |
( |
uint8_t |
emitterPin = SENSOR_LEDON | ) |
|
|
inline |
Configures this object to use just three line sensors.
This function configures this object to just use line sensors 1, 3, and
Definition at line 68 of file Zumo32U4LineSensors.h.
◆ read()
void QTRSensors::read |
( |
unsigned int * |
sensor_values, |
|
|
unsigned char |
readMode = QTR_EMITTERS_ON |
|
) |
| |
|
inherited |
◆ readCalibrated()
void QTRSensors::readCalibrated |
( |
unsigned int * |
sensor_values, |
|
|
unsigned char |
readMode = QTR_EMITTERS_ON |
|
) |
| |
|
inherited |
◆ readLine()
int QTRSensors::readLine |
( |
unsigned int * |
sensor_values, |
|
|
unsigned char |
readMode = QTR_EMITTERS_ON , |
|
|
unsigned char |
white_line = 0 |
|
) |
| |
|
inherited |
◆ resetCalibration()
void QTRSensors::resetCalibration |
( |
| ) |
|
|
inherited |
◆ _emitterPin
unsigned char QTRSensors::_emitterPin |
|
protectedinherited |
◆ _lastValue
int QTRSensors::_lastValue |
|
protectedinherited |
◆ _maxValue
unsigned int QTRSensors::_maxValue |
|
protectedinherited |
◆ _numSensors
unsigned char QTRSensors::_numSensors |
|
protectedinherited |
◆ _pins
unsigned char* QTRSensors::_pins |
|
protectedinherited |
◆ calibratedMaximumOff
unsigned int* QTRSensors::calibratedMaximumOff |
|
inherited |
◆ calibratedMaximumOn
unsigned int* QTRSensors::calibratedMaximumOn |
|
inherited |
◆ calibratedMinimumOff
unsigned int* QTRSensors::calibratedMinimumOff |
|
inherited |
◆ calibratedMinimumOn
unsigned int* QTRSensors::calibratedMinimumOn |
|
inherited |
The documentation for this class was generated from the following file: