Adafruit LTR-329 and LTR-303 Light Sensors Library
|
Class that stores state and functions for interacting with LTR303 Light Sensor. More...
#include <Adafruit_LTR329_LTR303.h>
Public Member Functions | |
Adafruit_LTR303 () | |
Instantiates a new LTR303 class. | |
void | enableInterrupt (bool en) |
Enables the interrupt output pin. More... | |
void | setInterruptPolarity (bool pol) |
The INT pin has a polarity setting for active low or high! More... | |
void | setLowThreshold (uint16_t value) |
The low threshold for ALS reading interrupts : values BELOW this trigger an interrupt. More... | |
uint16_t | getLowThreshold (void) |
The low threshold for ALS reading interrupt getter. More... | |
void | setHighThreshold (uint16_t value) |
The high threshold for ALS reading interrupts : values ABOVE this trigger an interrupt. More... | |
uint16_t | getHighThreshold (void) |
The high threshold for ALS reading interrupt getter. More... | |
void | setIntPersistance (uint8_t counts) |
The default behavior is an interrupt on every value that is under/over the threshold ranges. However, you're more likely to get spurious IRQs, so we can set it to require "N counts in a row" before an IRQ. More... | |
uint8_t | getIntPersistance (void) |
Getter for the number of counts required to trigger IRQ. More... | |
![]() | |
Adafruit_LTR329 () | |
Instantiates a new LTR329 class. | |
bool | begin (TwoWire *theWire=&Wire) |
Setups the hardware for talking to the LTR329. More... | |
bool | reset (void) |
Perform a soft reset with 10ms delay. More... | |
void | enable (bool en) |
Enable or disable the light sensor. More... | |
bool | enabled (void) |
Read the enabled-bit from the sensor. More... | |
void | setGain (ltr329_gain_t gain) |
Set the sensor gain. More... | |
ltr329_gain_t | getGain (void) |
Get the sensor's gain. More... | |
void | setIntegrationTime (ltr329_integrationtime_t inttime) |
Set the sensor integration time. Longer times are more sensitive but take longer to read! More... | |
ltr329_integrationtime_t | getIntegrationTime (void) |
Get the sensor's integration time for light sensing. More... | |
void | setMeasurementRate (ltr329_measurerate_t rate) |
Set the sensor measurement rate. Longer times are needed when the integration time is longer OR if you want to have lower power usage. More... | |
ltr329_measurerate_t | getMeasurementRate (void) |
Get the sensor's measurement rate. More... | |
bool | newDataAvailable (void) |
Checks if new data is available in data register. More... | |
bool | readBothChannels (uint16_t &ch0, uint16_t &ch1) |
Read both 16-bit channels at once, and place data into argument pointers. More... | |
Additional Inherited Members | |
![]() | |
Adafruit_I2CDevice * | i2c_dev = NULL |
The underlying I2C interface. | |
Class that stores state and functions for interacting with LTR303 Light Sensor.
void Adafruit_LTR303::enableInterrupt | ( | bool | en | ) |
Enables the interrupt output pin.
en | Pass in 'true' to enable the output pin, false to tri-state |
void Adafruit_LTR303::setInterruptPolarity | ( | bool | pol | ) |
The INT pin has a polarity setting for active low or high!
pol | For active LOW set to 'false', for active HIGH set to 'true' |
void Adafruit_LTR303::setLowThreshold | ( | uint16_t | value | ) |
The low threshold for ALS reading interrupts : values BELOW this trigger an interrupt.
value | This number is compared against the 'visible + IR' data register |
uint16_t Adafruit_LTR303::getLowThreshold | ( | void | ) |
The low threshold for ALS reading interrupt getter.
void Adafruit_LTR303::setHighThreshold | ( | uint16_t | value | ) |
The high threshold for ALS reading interrupts : values ABOVE this trigger an interrupt.
value | This number is compared against the 'visible + IR' data register |
uint16_t Adafruit_LTR303::getHighThreshold | ( | void | ) |
The high threshold for ALS reading interrupt getter.
void Adafruit_LTR303::setIntPersistance | ( | uint8_t | counts | ) |
The default behavior is an interrupt on every value that is under/over the threshold ranges. However, you're more likely to get spurious IRQs, so we can set it to require "N counts in a row" before an IRQ.
counts | 1 count is IRQ for each reading, 2 counts means we need two outside readings in a row, etc up to 16. |
uint8_t Adafruit_LTR303::getIntPersistance | ( | void | ) |
Getter for the number of counts required to trigger IRQ.