18 #ifndef _ADAFRUIT_LTR329_LTR303_H 19 #define _ADAFRUIT_LTR329_LTR303_H 22 #include <Adafruit_I2CDevice.h> 23 #include <Adafruit_I2CRegister.h> 26 #define LTR329_I2CADDR_DEFAULT 0x29 27 #define LTR329_PART_ID 0x86 28 #define LTR329_MANU_ID 0x87 29 #define LTR329_ALS_CTRL 0x80 30 #define LTR329_STATUS 0x8C 31 #define LTR329_CH1DATA 0x88 32 #define LTR329_MEAS_RATE 0x85 35 #define LTR303_REG_INTERRUPT 0x8F 36 #define LTR303_REG_THRESHHIGH_LSB 0x97 37 #define LTR303_REG_THRESHLOW_LSB 0x99 38 #define LTR303_REG_INTPERSIST 0x9E 80 bool begin(TwoWire *theWire = &Wire);
102 Adafruit_I2CRegister *StatusReg = NULL;
103 Adafruit_I2CRegisterBits *DataReadyBit = NULL;
104 Adafruit_I2CRegisterBits *DataInvalidBit = NULL;
115 void enableInterrupt(
bool en);
116 void setInterruptPolarity(
bool pol);
118 void setLowThreshold(uint16_t value);
119 uint16_t getLowThreshold(
void);
121 void setHighThreshold(uint16_t value);
122 uint16_t getHighThreshold(
void);
124 void setIntPersistance(uint8_t counts);
125 uint8_t getIntPersistance(
void);
Adafruit_I2CDevice * i2c_dev
The underlying I2C interface.
Definition: Adafruit_LTR329_LTR303.h:99
Adafruit_LTR329()
Instantiates a new LTR329 class.
Definition: Adafruit_LTR329_LTR303.cpp:37
ltr329_integrationtime_t
Integration times, in milliseconds.
Definition: Adafruit_LTR329_LTR303.h:52
ltr329_integrationtime_t getIntegrationTime(void)
Get the sensor's integration time for light sensing.
Definition: Adafruit_LTR329_LTR303.cpp:178
bool begin(TwoWire *theWire=&Wire)
Setups the hardware for talking to the LTR329.
Definition: Adafruit_LTR329_LTR303.cpp:49
void setIntegrationTime(ltr329_integrationtime_t inttime)
Set the sensor integration time. Longer times are more sensitive but take longer to read! ...
Definition: Adafruit_LTR329_LTR303.cpp:162
bool reset(void)
Perform a soft reset with 10ms delay.
Definition: Adafruit_LTR329_LTR303.cpp:92
ltr329_gain_t getGain(void)
Get the sensor's gain.
Definition: Adafruit_LTR329_LTR303.cpp:146
ltr329_measurerate_t getMeasurementRate(void)
Get the sensor's measurement rate.
Definition: Adafruit_LTR329_LTR303.cpp:209
void setMeasurementRate(ltr329_measurerate_t rate)
Set the sensor measurement rate. Longer times are needed when the integration time is longer OR if yo...
Definition: Adafruit_LTR329_LTR303.cpp:194
Class that stores state and functions for interacting with LTR329 Light Sensor.
Definition: Adafruit_LTR329_LTR303.h:77
void setGain(ltr329_gain_t gain)
Set the sensor gain.
Definition: Adafruit_LTR329_LTR303.cpp:133
ltr329_measurerate_t
Measurement rates, in milliseconds.
Definition: Adafruit_LTR329_LTR303.h:64
ltr329_gain_t
Sensor gain for ALS.
Definition: Adafruit_LTR329_LTR303.h:41
bool readBothChannels(uint16_t &ch0, uint16_t &ch1)
Read both 16-bit channels at once, and place data into argument pointers.
Definition: Adafruit_LTR329_LTR303.cpp:231
bool newDataAvailable(void)
Checks if new data is available in data register.
Definition: Adafruit_LTR329_LTR303.cpp:222
bool enabled(void)
Read the enabled-bit from the sensor.
Definition: Adafruit_LTR329_LTR303.cpp:120
void enable(bool en)
Enable or disable the light sensor.
Definition: Adafruit_LTR329_LTR303.cpp:108
Class that stores state and functions for interacting with LTR303 Light Sensor.
Definition: Adafruit_LTR329_LTR303.h:111