Class that stores state and functions for interacting with VEML7700 Light Sensor.
More...
#include <Adafruit_VEML7700.h>
Class that stores state and functions for interacting with VEML7700 Light Sensor.
◆ begin()
bool Adafruit_VEML7700::begin |
( |
TwoWire * |
theWire = &Wire | ) |
|
Sets up the hardware for talking to the VEML7700.
- Parameters
-
theWire | An optional pointer to an I2C interface |
- Returns
- True if initialization was successful, otherwise false.
◆ enable()
void Adafruit_VEML7700::enable |
( |
bool |
enable | ) |
|
Enable or disable the sensor.
- Parameters
-
enable | The flag to enable/disable |
◆ enabled()
bool Adafruit_VEML7700::enabled |
( |
void |
| ) |
|
Ask if the interrupt is enabled.
- Returns
- True if enabled, false otherwise
◆ interruptEnable()
void Adafruit_VEML7700::interruptEnable |
( |
bool |
enable | ) |
|
Enable or disable the interrupt.
- Parameters
-
enable | The flag to enable/disable |
◆ interruptEnabled()
bool Adafruit_VEML7700::interruptEnabled |
( |
void |
| ) |
|
Ask if the interrupt is enabled.
- Returns
- True if enabled, false otherwise
◆ setPersistence()
void Adafruit_VEML7700::setPersistence |
( |
uint8_t |
pers | ) |
|
Set the ALS IRQ persistence setting.
- Parameters
-
pers | Persistence constant, can be VEML7700_PERS_1, VEML7700_PERS_2, VEML7700_PERS_4 or VEML7700_PERS_8 |
◆ getPersistence()
uint8_t Adafruit_VEML7700::getPersistence |
( |
void |
| ) |
|
Get the ALS IRQ persistence setting.
- Returns
- Persistence constant, can be VEML7700_PERS_1, VEML7700_PERS_2, VEML7700_PERS_4 or VEML7700_PERS_8
◆ setIntegrationTime()
void Adafruit_VEML7700::setIntegrationTime |
( |
uint8_t |
it, |
|
|
bool |
wait = true |
|
) |
| |
Set ALS integration time.
- Parameters
-
it | Can be VEML7700_IT_100MS, VEML7700_IT_200MS, VEML7700_IT_400MS, VEML7700_IT_800MS, VEML7700_IT_50MS or VEML7700_IT_25MS |
wait | Waits to insure old integration time cycle has completed. This is a blocking delay. If disabled by passing false, user code must insure a new reading is not done before old integration cycle completes. |
◆ getIntegrationTime()
uint8_t Adafruit_VEML7700::getIntegrationTime |
( |
void |
| ) |
|
Get ALS integration time setting.
- Returns
- IT index, can be VEML7700_IT_100MS, VEML7700_IT_200MS, VEML7700_IT_400MS, VEML7700_IT_800MS, VEML7700_IT_50MS or VEML7700_IT_25MS
◆ getIntegrationTimeValue()
int Adafruit_VEML7700::getIntegrationTimeValue |
( |
void |
| ) |
|
Get ALS integration time value.
- Returns
- ALS integration time in milliseconds
◆ setGain()
void Adafruit_VEML7700::setGain |
( |
uint8_t |
gain | ) |
|
Set ALS gain.
- Parameters
-
gain | Can be VEML7700_GAIN_1, VEML7700_GAIN_2, VEML7700_GAIN_1_8 or VEML7700_GAIN_1_4 |
◆ getGain()
uint8_t Adafruit_VEML7700::getGain |
( |
void |
| ) |
|
Get ALS gain setting.
- Returns
- Gain index, can be VEML7700_GAIN_1, VEML7700_GAIN_2, VEML7700_GAIN_1_8 or VEML7700_GAIN_1_4
◆ getGainValue()
float Adafruit_VEML7700::getGainValue |
( |
void |
| ) |
|
Get ALS gain value.
- Returns
- Actual gain value as float
◆ powerSaveEnable()
void Adafruit_VEML7700::powerSaveEnable |
( |
bool |
enable | ) |
|
Enable power save mode.
- Parameters
-
enable | True if power save should be enabled |
◆ powerSaveEnabled()
bool Adafruit_VEML7700::powerSaveEnabled |
( |
void |
| ) |
|
Check if power save mode is enabled.
- Returns
- True if power save is enabled
◆ setPowerSaveMode()
void Adafruit_VEML7700::setPowerSaveMode |
( |
uint8_t |
mode | ) |
|
Assign the power save register data.
- Parameters
-
mode | The 16-bit data to write to VEML7700_ALS_POWER_SAVE |
◆ getPowerSaveMode()
uint8_t Adafruit_VEML7700::getPowerSaveMode |
( |
void |
| ) |
|
Retrieve the power save register data.
- Returns
- 16-bit data from VEML7700_ALS_POWER_SAVE
◆ setLowThreshold()
void Adafruit_VEML7700::setLowThreshold |
( |
uint16_t |
value | ) |
|
Assign the low threshold register data.
- Parameters
-
value | The 16-bit data to write to VEML7700_ALS_THREHOLD_LOW |
◆ getLowThreshold()
uint16_t Adafruit_VEML7700::getLowThreshold |
( |
void |
| ) |
|
Retrieve the low threshold register data.
- Returns
- 16-bit data from VEML7700_ALS_THREHOLD_LOW
◆ setHighThreshold()
void Adafruit_VEML7700::setHighThreshold |
( |
uint16_t |
value | ) |
|
Assign the high threshold register data.
- Parameters
-
value | The 16-bit data to write to VEML7700_ALS_THREHOLD_HIGH |
◆ getHighThreshold()
uint16_t Adafruit_VEML7700::getHighThreshold |
( |
void |
| ) |
|
Retrieve the high threshold register data.
- Returns
- 16-bit data from VEML7700_ALS_THREHOLD_HIGH
◆ interruptStatus()
uint16_t Adafruit_VEML7700::interruptStatus |
( |
void |
| ) |
|
Retrieve the interrupt status register data.
- Returns
- 16-bit data from VEML7700_INTERRUPTSTATUS
◆ readALS()
uint16_t Adafruit_VEML7700::readALS |
( |
bool |
wait = false | ) |
|
Read the raw ALS data.
- Parameters
-
wait | If false (default), read out measurement with no delay. If true, wait as need based on integration time before reading out measurement results. |
- Returns
- 16-bit data value from the ALS register
◆ readWhite()
uint16_t Adafruit_VEML7700::readWhite |
( |
bool |
wait = false | ) |
|
Read the raw white light data.
- Parameters
-
wait | If false (default), read out measurement with no delay. If true, wait as need based on integration time before reading out measurement results. |
- Returns
- 16-bit data value from the WHITE register
◆ readLux()
float Adafruit_VEML7700::readLux |
( |
luxMethod |
method = VEML_LUX_NORMAL | ) |
|
Read the calibrated lux value. See app note lux table on page 5.
- Parameters
-
method | Lux comptation method to use. One of |
- Returns
- Floating point Lux data
The documentation for this class was generated from the following files: