SparkFun Ambient Light Sensor - VEML7700  v2.0.0-1-g1693613
Library for the SparkFun Ambient Light Sensor - VEML7700
Loading...
Searching...
No Matches
sfDevVEML7700.cpp File Reference
#include "sfDevVEML7700.h"
#include "Arduino.h"
Include dependency graph for sfDevVEML7700.cpp:

Variables

const float VEML7700_LUX_RESOLUTION [VEML7700_SENSITIVITY_INVALID][VEML7700_INTEGRATION_INVALID]
 Lookup table for VEML7700 lux resolution values. More...
 
const char * kVEML7700GainSettingsString [VEML7700_SENSITIVITY_INVALID+1] = {"x1", "x2", "x1/8", "x1/4", "INVALID"}
 Array of string representations for VEML7700 gain (sensitivity) settings. More...
 
const char * kVEML7799IntegrationTimesString [VEML7700_INTEGRATION_INVALID+1]
 Array of string representations for VEML7700 sensor integration times. More...
 
const char * kVEML7700PersistenceProtectStrings [VEML7700_PERSISTENCE_INVALID+1] = {"1", "2", "4", "8", "INVALID"}
 String representations for VEML7700 persistence protection settings. More...
 

Detailed Description

This library facilitates communication with the VEML7700 over I2C.

Want to support open source hardware? Buy a board from SparkFun!

Author

This library was written by: Paul Clark SparkFun Electronics November 4th 2021

Author
SparkFun Electronics
Date
2021-2025

SPDX-License-Identifier: MIT

Variable Documentation

◆ kVEML7700GainSettingsString

const char* kVEML7700GainSettingsString[VEML7700_SENSITIVITY_INVALID+1] = {"x1", "x2", "x1/8", "x1/4", "INVALID"}

Array of string representations for VEML7700 gain (sensitivity) settings.

This array maps each gain setting constant to its corresponding string value:

  • "x1" : Gain setting x1
  • "x2" : Gain setting x2
  • "x1/8" : Gain setting x1/8
  • "x1/4" : Gain setting x1/4
  • "INVALID": Invalid gain setting

The array size is determined by VEML7700_SENSITIVITY_INVALID + 1 to include all possible gain settings.

Note
The array is indexed by the VEML7700_sensitivity_mode_t enum values.

◆ kVEML7700PersistenceProtectStrings

const char* kVEML7700PersistenceProtectStrings[VEML7700_PERSISTENCE_INVALID+1] = {"1", "2", "4", "8", "INVALID"}

String representations for VEML7700 persistence protection settings.

This array maps the persistence protection enumeration values to their corresponding string representations. The strings represent the number of persistence events required before an interrupt is triggered. The last entry "INVALID" corresponds to an invalid persistence setting.

Index mapping: 0: "1" - 1 persistence event 1: "2" - 2 persistence events 2: "4" - 4 persistence events 3: "8" - 8 persistence events 4: "INVALID" - Invalid persistence setting

◆ kVEML7799IntegrationTimesString

const char* kVEML7799IntegrationTimesString[VEML7700_INTEGRATION_INVALID+1]
Initial value:
= {"25ms", "50ms", "100ms", "200ms",
"400ms", "800ms", "INVALID"}

Array of string representations for VEML7700 sensor integration times.

Each element corresponds to a specific integration time setting for the VEML7700 sensor. The last element "INVALID" represents an invalid or unsupported integration time.

Index mapping: 0 - "25ms" 1 - "50ms" 2 - "100ms" 3 - "200ms" 4 - "400ms" 5 - "800ms" 6 - "INVALID"

◆ VEML7700_LUX_RESOLUTION

const float VEML7700_LUX_RESOLUTION[VEML7700_SENSITIVITY_INVALID][VEML7700_INTEGRATION_INVALID]
Initial value:
= {
{0.2304, 0.1152, 0.0576, 0.0288, 0.0144, 0.0072},
{0.1152, 0.0576, 0.0288, 0.0144, 0.0072, 0.0036},
{1.8432, 0.9216, 0.4608, 0.2304, 0.1152, 0.0576},
{0.9216, 0.4608, 0.2304, 0.1152, 0.0576, 0.0288}
}

Lookup table for VEML7700 lux resolution values.

This 2D array provides the lux resolution (in lux/count) for different gain (sensitivity) and integration time settings of the VEML7700 ambient light sensor. The first dimension corresponds to the gain setting, and the second dimension corresponds to the integration time setting.

Gain (sensitivity) indices: 0: Gain 1 1: Gain 2 2: Gain 1/8 3: Gain 1/4

Integration time indices: 0: 25ms 1: 50ms 2: 100ms 3: 200ms 4: 400ms 5: 800ms

Each element [gain][integration_time] gives the corresponding lux resolution for that configuration.