29 static const uint8_t emitterPin = 11;
30 static const uint8_t bumpLeftPin = 4;
31 static const uint8_t bumpRightPin = 5;
Gets readings from the two bump sensors on the front of the 3pi+ 32U4.
uint16_t sensorValues[2]
Raw reflectance sensor readings.
bool leftChanged()
Indicates whether the left bump sensor's state has changed.
uint16_t threshold[2]
Thresholds for bump sensor press detection.
uint16_t marginPercentage
The amount, as a percentage, that will be added to the measured baseline to get the threshold.
uint16_t baseline[2]
Baseline readings obtained from calibration.
uint8_t read()
Reads both bump sensors.
bool rightIsPressed()
Indicates whether the right bump sensor is pressed.
bool leftIsPressed()
Indicates whether the left bump sensor is pressed.
uint16_t timeout
Timeout for bump sensor readings (in microseconds).
static const uint16_t defaultTimeout
Default timeout for RC sensors (in microseconds).
bool rightChanged()
Indicates whether the right bump sensor's state has changed.
void calibrate(uint8_t count=50)
Calibrates the bump sensors.
Top-level namespace for the Pololu3piPlus32U4 library.
BumpSide
Bump sensor sides.
@ BumpRight
Right bump sensor.
@ BumpLeft
Left bump sensor.