45 static const uint8_t emitterPin = 11;
46 static const uint8_t line0Pin = 12;
47 static const uint8_t line1Pin = A0;
48 static const uint8_t line2Pin = A2;
49 static const uint8_t line3Pin = A3;
50 static const uint8_t line4Pin = A4;
206 return readLinePrivate(sensorValues, mode,
false);
231 return readLinePrivate(sensorValues, mode,
true);
268 FastGPIO::Pin<emitterPin>::setOutputHigh();
274 FastGPIO::Pin<emitterPin>::setInput();
283 void readPrivate(uint16_t * sensorValues);
285 uint16_t readLinePrivate(uint16_t * sensorValues,
LineSensorsReadMode mode,
bool invertReadings);
289 uint16_t _lastPosition = 0;
Gets readings from the five reflectance sensors on the bottom of the 3pi+ 32U4.
static const uint16_t defaultTimeout
Default timeout for RC sensors (in microseconds).
void emittersOff()
Turns the IR LEDs off.
CalibrationData calibrationOn
Data from calibrating with emitters on.
uint16_t readLineWhite(uint16_t *sensorValues, LineSensorsReadMode mode=LineSensorsReadMode::On)
Reads the sensors, provides calibrated values, and returns an estimated white line position.
uint16_t getTimeout()
Returns the timeout.
void resetCalibration()
Resets all calibration that has been done.
void readCalibrated(uint16_t *sensorValues, LineSensorsReadMode mode=LineSensorsReadMode::On)
Reads the sensors and provides calibrated values between 0 and 1000.
static const uint8_t _sensorCount
The 3pi+ 32U4 has 5 line sensors.
void read(uint16_t *sensorValues, LineSensorsReadMode mode=LineSensorsReadMode::On)
Reads the raw sensor values into an array.
void emittersOn()
Turns the IR LEDs on.
CalibrationData calibrationOff
Data from calibrating with emitters off.
void setTimeout(uint16_t timeout)
Sets the timeout for RC sensors.
void calibrate(LineSensorsReadMode mode=LineSensorsReadMode::On)
Reads the sensors for calibration.
uint16_t readLineBlack(uint16_t *sensorValues, LineSensorsReadMode mode=LineSensorsReadMode::On)
Reads the sensors, provides calibrated values, and returns an estimated black line position.
Top-level namespace for the Pololu3piPlus32U4 library.
LineSensorsReadMode
Emitter behavior when taking readings.
Stores sensor calibration data.
uint16_t * maximum
Highest readings seen during calibration.
bool initialized
Whether array pointers have been allocated and initialized.
uint16_t * minimum
Lowest readings seen during calibration.