Class that stores state and functions for interacting with LTR329 Light Sensor.
More...
#include <Adafruit_LTR329_LTR303.h>
|
Adafruit_I2CDevice * | i2c_dev = NULL |
| The underlying I2C interface.
|
|
Class that stores state and functions for interacting with LTR329 Light Sensor.
◆ begin()
bool Adafruit_LTR329::begin |
( |
TwoWire * |
theWire = &Wire | ) |
|
Setups the hardware for talking to the LTR329.
- Parameters
-
theWire | An optional pointer to an I2C interface |
- Returns
- True if initialization was successful, otherwise false.
◆ reset()
bool Adafruit_LTR329::reset |
( |
void |
| ) |
|
Perform a soft reset with 10ms delay.
- Returns
- True on success
◆ enable()
void Adafruit_LTR329::enable |
( |
bool |
en | ) |
|
Enable or disable the light sensor.
- Parameters
-
en | True to enable, False to disable |
◆ enabled()
bool Adafruit_LTR329::enabled |
( |
void |
| ) |
|
Read the enabled-bit from the sensor.
- Returns
- True if enabled
◆ setGain()
Set the sensor gain.
- Parameters
-
gain | The desired gain: LTR3XX_GAIN_1, LTR3XX_GAIN_2, LTR3XX_GAIN_4 LTR3XX_GAIN_8, LTR3XX_GAIN_48 or LTR3XX_GAIN_96 |
◆ getGain()
Get the sensor's gain.
- Returns
- gain The current gain: LTR3XX_GAIN_1, LTR3XX_GAIN_2, LTR3XX_GAIN_4 LTR3XX_GAIN_8, LTR3XX_GAIN_48 or LTR3XX_GAIN_96
◆ setIntegrationTime()
Set the sensor integration time. Longer times are more sensitive but take longer to read!
- Parameters
-
inttime | The desired integration time (in millis): LTR3XX_INTEGTIME_50, LTR3XX_INTEGTIME_100, LTR3XX_INTEGTIME_150, LTR3XX_INTEGTIME_200,LTR3XX_INTEGTIME_250, LTR3XX_INTEGTIME_300, LTR3XX_INTEGTIME_350, LTR3XX_INTEGTIME_400, |
◆ getIntegrationTime()
Get the sensor's integration time for light sensing.
- Returns
- The current integration time, in milliseconds. LTR3XX_INTEGTIME_50, LTR3XX_INTEGTIME_100, LTR3XX_INTEGTIME_150, LTR3XX_INTEGTIME_200,LTR3XX_INTEGTIME_250, LTR3XX_INTEGTIME_300, LTR3XX_INTEGTIME_350, LTR3XX_INTEGTIME_400,
◆ setMeasurementRate()
Set the sensor measurement rate. Longer times are needed when the integration time is longer OR if you want to have lower power usage.
- Parameters
-
rate | The desired measurement rate (in millis): LTR3XX_MEASRATE_50, LTR3XX_MEASRATE_100, LTR3XX_MEASRATE_200, LTR3XX_MEASRATE_500, LTR3XX_MEASRATE_1000, or LTR3XX_MEASRATE_2000 |
◆ getMeasurementRate()
Get the sensor's measurement rate.
- Returns
- The current measurement rate (in millis): LTR3XX_MEASRATE_50, LTR3XX_MEASRATE_100, LTR3XX_MEASRATE_200, LTR3XX_MEASRATE_500, LTR3XX_MEASRATE_1000, or LTR3XX_MEASRATE_2000
◆ newDataAvailable()
bool Adafruit_LTR329::newDataAvailable |
( |
void |
| ) |
|
Checks if new data is available in data register.
- Returns
- True on new data available
◆ readBothChannels()
bool Adafruit_LTR329::readBothChannels |
( |
uint16_t & |
ch0, |
|
|
uint16_t & |
ch1 |
|
) |
| |
Read both 16-bit channels at once, and place data into argument pointers.
- Parameters
-
ch0 | Reference to uint16_t where visible+IR data will be stored |
ch1 | Reference to uint16_t where IR-only data will be stored |
- Returns
- True if data is valid (no over-run), false on bad data
The documentation for this class was generated from the following files: