![]() |
SparkFun Ambient Light Sensor - VEML7700
v2.0.0-1-g1693613
Library for the SparkFun Ambient Light Sensor - VEML7700
|
Class for interfacing with the VMEL7700 sensor using I2C communication. More...
#include <SparkFun_VEML7700_Arduino_Library.h>
Public Member Functions | |
bool | begin (const uint8_t address=SF_VEML7700_DEFAULT_ADDRESS, TwoWire &wirePort=Wire) |
Begins the Device with I2C as the communication bus. More... | |
sfTkError_t | begin (sfTkIBus *theBus=nullptr) |
Initializes the VEML7700 device on the specified bus. More... | |
bool | isConnected () |
Checks if the VEML7700 sensor is connected and responding. More... | |
sfTkError_t | setShutdown (bool) |
Sets the shutdown mode of the VEML7700 device. More... | |
sfTkError_t | powerOn (void) |
Powers on the VEML7700 device by clearing the shutdown mode. More... | |
sfTkError_t | shutdown (void) |
Puts the VEML7700 device into shutdown mode. More... | |
bool | isShutdown (void) |
Checks if the VEML7700 device is currently in shutdown mode. More... | |
sfTkError_t | enableInterrupt (bool) |
Enables or disables the interrupt functionality of the VEML7700 device. More... | |
bool | isInterruptEnabled (void) |
Checks if the interrupt feature is enabled on the VEML7700 device. More... | |
sfTkError_t | setPersistenceProtect (VEML7700_persistence_protect_t pp) |
Sets the persistence protection mode for the VEML7700 sensor. More... | |
sfTkError_t | getPersistenceProtect (VEML7700_persistence_protect_t &pp) |
Retrieves the current persistence protection setting from the VEML7700 sensor. More... | |
VEML7700_persistence_protect_t | getPersistenceProtect (void) |
Get the Persistence Protect object - this is for backward compatibility. More... | |
VEML7700_persistence_protect_t | persistenceProtect (void) |
Gets the current persistence protection setting of the VEML7700 sensor. More... | |
const char * | persistenceProtectString (void) |
Returns a string representation of the current persistence protection setting. More... | |
const char * | getPersistenceProtectStr (void) |
Get the Persistence Protect object - this is for backward compatibility. More... | |
sfTkError_t | setIntegrationTime (VEML7700_integration_time_t it) |
Sets the integration time for the VEML7700 sensor. More... | |
sfTkError_t | getIntegrationTime (VEML7700_integration_time_t &it) |
Retrieves the current integration time setting from the VEML7700 sensor. More... | |
VEML7700_integration_time_t | getIntegrationTime (void) |
Get the Integration Time object - this is for backward compatibility. More... | |
VEML7700_integration_time_t | integrationTime (void) |
Gets the current integration time setting of the VEML7700 sensor. More... | |
const char * | integrationTimeString (void) |
Returns a string representation of the current integration time setting. More... | |
const char * | getIntegrationTimeStr (void) |
Get the Integration Time string - this is for backward compatibility. More... | |
sfTkError_t | setSensitivityMode (VEML7700_sensitivity_mode_t sm) |
Sets the sensitivity mode for the VEML7700 sensor. More... | |
sfTkError_t | getSensitivityMode (VEML7700_sensitivity_mode_t &sm) |
Retrieves the current sensitivity mode setting from the VEML7700 sensor. More... | |
VEML7700_sensitivity_mode_t | getSensitivityMode (void) |
Get the Sensitivity Mode object - this is for backward compatibility. More... | |
VEML7700_sensitivity_mode_t | sensitivityMode (void) |
Gets the current sensitivity mode setting of the VEML7700 sensor. More... | |
const char * | sensitivityModeString (void) |
Returns a string representation of the current sensitivity mode setting. More... | |
const char * | getSensitivityModeStr (void) |
Get the Sensitivity Mode string - this is for backward compatibility. More... | |
sfTkError_t | setHighThreshold (uint16_t threshold) |
Sets the high threshold value for the VEML7700 sensor. More... | |
sfTkError_t | getHighThreshold (uint16_t &threshold) |
Retrieves the current high threshold value from the VEML7700 sensor. More... | |
uint16_t | getHighThreshold (void) |
Get the High Threshold object - this is for backward compatibility. More... | |
uint16_t | highThreshold (void) |
Gets the current high threshold value of the VEML7700 sensor. More... | |
sfTkError_t | setLowThreshold (uint16_t threshold) |
Sets the low threshold value for the VEML7700 sensor. More... | |
sfTkError_t | getLowThreshold (uint16_t &threshold) |
Retrieves the current low threshold value from the VEML7700 sensor. More... | |
uint16_t | getLowThreshold (void) |
Get the Low Threshold object - this is for backward compatibility. More... | |
uint16_t | lowThreshold (void) |
Gets the current low threshold value of the VEML7700 sensor. More... | |
sfTkError_t | getAmbientLight (uint16_t &ambient) |
Retrieves the ambient light measurement from the VEML7700 sensor. More... | |
uint16_t | getAmbientLight (void) |
Reads the ambient light measurement from the VEML7700 sensor. More... | |
sfTkError_t | getWhiteLevel (uint16_t &whiteLevel) |
Retrieves the current white light level measured by the VEML7700 sensor. More... | |
uint16_t | getWhiteLevel (void) |
Reads the current white light level from the VEML7700 sensor. More... | |
sfTkError_t | getLux (float &lux) |
Retrieves the current ambient light level in lux. More... | |
float | getLux (void) |
Reads the current ambient light level in lux. More... | |
VEML7700_interrupt_status_t | interruptStatus (void) |
Retrieves the current interrupt status from the VEML7700 sensor. More... | |
VEML7700_interrupt_status_t | getInterruptStatus (void) |
Gets the interrupt status of the VEML7700 sensor. More... | |
Class for interfacing with the VMEL7700 sensor using I2C communication.
This class provides methods to initialize and communicate with the BMV080 sensor over an I2C bus. It inherits from the sfDevVEML7700 class and uses the SparkFun Toolkit for I2C communication.
|
inline |
Begins the Device with I2C as the communication bus.
This method initializes the I2C bus and sets up communication with the VEML7700 sensor.
address | I2C device address to use for the sensor |
wirePort | Wire port to use for I2C communication |
|
inherited |
Initializes the VEML7700 device on the specified bus.
This function sets up communication with the VEML7700 sensor using the provided bus interface. If no bus is specified, the method will fail and return an error.
theBus | Pointer to the bus interface (sfTkIBus) to use for communication. Defaults to nullptr. |
Write _configurationRegister into the VEML7700_CONFIGURATION_REGISTER. This will place the device into a known state, in case it was configured previously and remained powered on when the code was restarted.
|
inherited |
Enables or disables the interrupt functionality of the VEML7700 device.
When enabled, the device will generate an interrupt signal based on its configuration.
enable | Set to true to enable interrupts, false to disable. |
|
inherited |
Retrieves the ambient light measurement from the VEML7700 sensor.
Read the sensor data
This function reads the current ambient light value and stores it in the provided reference variable.
[out] | ambient | Reference to a uint16_t variable where the ambient light value will be stored. |
|
inherited |
Reads the ambient light measurement from the VEML7700 sensor.
This function retrieves the current ambient light value.
|
inherited |
Retrieves the current high threshold value from the VEML7700 sensor.
This function reads the sensor's configuration to obtain the currently set high threshold value.
[out] | threshold | Reference to a uint16_t variable where the high threshold will be stored. |
|
inlineinherited |
Get the High Threshold object - this is for backward compatibility.
|
inherited |
Retrieves the current integration time setting from the VEML7700 sensor.
This function reads the sensor's configuration to determine the currently set integration time.
[out] | it | Reference to a VEML7700_integration_time_t variable where the integration time will be stored. |
|
inlineinherited |
Get the Integration Time object - this is for backward compatibility.
|
inlineinherited |
Get the Integration Time string - this is for backward compatibility.
|
inlineinherited |
Gets the interrupt status of the VEML7700 sensor.
|
inherited |
Retrieves the current low threshold value from the VEML7700 sensor.
This function reads the sensor's configuration to obtain the currently set low threshold value.
[out] | threshold | Reference to a uint16_t variable where the low threshold will be stored. |
|
inlineinherited |
Get the Low Threshold object - this is for backward compatibility.
|
inherited |
Retrieves the current ambient light level in lux.
This function reads the sensor and calculates the ambient light intensity, storing the result in the provided reference variable.
lux | Reference to a float variable where the measured lux value will be stored. |
|
inherited |
Reads the current ambient light level in lux.
This function calculates the lux value based on the sensor's ambient light measurement.
|
inherited |
Retrieves the current persistence protection setting from the VEML7700 sensor.
This function queries the sensor for its persistence protection configuration, which determines how many consecutive out-of-threshold measurements are required before an interrupt is triggered.
[out] | pp | Reference to a VEML7700_persistence_protect_t variable where the persistence protection value will be stored. |
|
inlineinherited |
Get the Persistence Protect object - this is for backward compatibility.
|
inlineinherited |
Get the Persistence Protect object - this is for backward compatibility.
|
inherited |
Retrieves the current sensitivity mode setting from the VEML7700 sensor.
This function reads the sensor's configuration to determine the currently set sensitivity mode.
[out] | sm | Reference to a VEML7700_sensitivity_mode_t variable where the sensitivity mode will be stored. |
|
inlineinherited |
Get the Sensitivity Mode object - this is for backward compatibility.
|
inlineinherited |
Get the Sensitivity Mode string - this is for backward compatibility.
|
inherited |
Retrieves the current white light level measured by the VEML7700 sensor.
This function reads the white channel value from the sensor and stores it in the provided reference variable.
[out] | whiteLevel | Reference to a uint16_t variable where the white light level will be stored. |
|
inherited |
Reads the current white light level from the VEML7700 sensor.
This function retrieves the white channel value measured by the sensor.
|
inherited |
Gets the current high threshold value of the VEML7700 sensor.
This function retrieves the high threshold that is currently configured for the sensor.
|
inherited |
Gets the current integration time setting of the VEML7700 sensor.
This function retrieves the integration time that is currently configured for the sensor.
|
inherited |
Returns a string representation of the current integration time setting.
This function provides a human-readable string that describes the current integration time.
|
inherited |
Retrieves the current interrupt status from the VEML7700 sensor.
This function queries the VEML7700 sensor for its interrupt status, indicating whether a threshold event has occurred (such as crossing high or low limits). The returned status can be used to determine if further action is required, such as reading sensor data or clearing the interrupt.
|
inherited |
Checks if the VEML7700 sensor is connected and responding.
|
inherited |
Checks if the interrupt feature is enabled on the VEML7700 device.
|
inherited |
Checks if the VEML7700 device is currently in shutdown mode.
This function returns true if the device is in shutdown mode, meaning it is not actively measuring. Otherwise, it returns false.
|
inherited |
Gets the current low threshold value of the VEML7700 sensor.
This function retrieves the low threshold that is currently configured for the sensor.
|
inherited |
Gets the current persistence protection setting of the VEML7700 sensor.
This function returns the persistence protection configuration, which determines how many consecutive out-of-range measurements are required before an interrupt is triggered.
|
inherited |
Returns a string representation of the current persistence protection setting.
This function provides a human-readable string that describes the current persistence protection mode.
|
inlineinherited |
Powers on the VEML7700 device by clearing the shutdown mode.
This function calls setShutdown(false) to enable the device's operation.
|
inherited |
Gets the current sensitivity mode setting of the VEML7700 sensor.
This function retrieves the sensitivity mode that is currently configured for the sensor.
|
inherited |
Returns a string representation of the current sensitivity mode setting.
This function provides a human-readable string that describes the current sensitivity mode.
|
inherited |
Sets the high threshold value for the VEML7700 sensor.
This function configures the high threshold for the sensor's interrupt. When the measured value exceeds this threshold, an interrupt will be triggered.
threshold | The high threshold value to set (16-bit unsigned integer): 0x0000 to 0xFFFF |
|
inherited |
Sets the integration time for the VEML7700 sensor.
This function configures the integration time, which determines the duration over which the sensor accumulates light before taking a measurement. Adjusting the integration time can affect the sensitivity and range of the sensor readings.
it | The desired integration time, specified as a value of the VEML7700_integration_time_t enumeration. |
|
inherited |
Sets the low threshold value for the VEML7700 sensor.
This function configures the sensor to trigger an interrupt or event when the measured value falls below the specified threshold.
threshold | The low threshold value to set (16-bit unsigned integer): 0x0000 to 0xFFFF |
|
inherited |
Sets the persistence protection mode for the VEML7700 sensor.
This function configures the persistence protection setting, which determines how many consecutive out-of-threshold events are required before an interrupt is triggered.
pp | The persistence protection mode to set. This should be a value of type VEML7700_persistence_protect_t. Valid values are: VEML7700_PERSISTENCE_1 VEML7700_PERSISTENCE_2 VEML7700_PERSISTENCE_4 VEML7700_PERSISTENCE_8 |
|
inherited |
Sets the sensitivity mode for the VEML7700 sensor.
This function configures the sensor's sensitivity mode, which affects the measurement range and resolution. The sensitivity mode should be selected based on the application's lighting conditions.
sm | The desired sensitivity mode, specified as a VEML7700_sensitivity_mode_t enum value. |
|
inherited |
Sets the shutdown mode of the VEML7700 device.
Configuration controls
This function enables or disables the shutdown mode of the sensor. When shutdown mode is enabled, the device enters a low-power state.
shutdown | If true, the device will enter shutdown mode; if false, it will operate normally. |
|
inlineinherited |
Puts the VEML7700 device into shutdown mode.
This function calls setShutdown(true) to transition the device into a low-power state.