Proximity Sensor Settings

Integration Period

The integration period of the sensor is how long it reads IR light for.

The sensor operates by emitting a pulse of IR light and recording the reflected light. The integration period is similar to the exposure time for a camera.

Longer integration times will be slightly more stable and have slightly longer range, at the tradeoff of slower reads. The default of 20ms is generally a good tradeoff between stability and speed.

//Sets the integration period to 20 ms
settings.setProximityIntegrationPeriod(ProximityPeriod.k20ms);
//Sets the integration period to 20 ms
settings.SetProximityIntegrationPeriod(ProximityPeriod::k20ms);