diff --git a/.github/workflows/add_issue_to_project.yml b/.github/workflows/add_issue_to_project.yml new file mode 100644 index 0000000..6b60cc3 --- /dev/null +++ b/.github/workflows/add_issue_to_project.yml @@ -0,0 +1,18 @@ +name: Add new issue to our main project + +on: + issues: + types: + - opened + +jobs: + add-to-project: + name: Add issue to project + runs-on: ubuntu-latest + steps: + - uses: actions/add-to-project@main + with: + # You can target a project in a different organization + # to the issue + project-url: https://github.com/orgs/sparkfun/projects/19 + github-token: ${{ secrets.DEFECT_ADD_TO_PROJECT }} diff --git a/.github/workflows/build-deploy-ghpages.yml b/.github/workflows/build-deploy-ghpages.yml new file mode 100644 index 0000000..b69a484 --- /dev/null +++ b/.github/workflows/build-deploy-ghpages.yml @@ -0,0 +1,64 @@ +name: Build Documentation and Deploy + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + id-token: write + pages: write + +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + # Checkout the repository + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + submodules: "true" + + - name: Set Version + run: echo "PROJECT_NUMBER = `git describe --tags`" >> ./docs/doxygen/doxygen-config + + - name: Build Documentation + uses: mattnotmitt/doxygen-action@v1.9.5 + with: + doxyfile-path: "./docs/doxygen/doxygen-config" + + # Upload the documentation as an artifact + - name: Upload documentation + uses: actions/upload-pages-artifact@v3.0.1 + with: + path: ./docs/html + + # Deploy job + deploy: + # Add a dependency to the build job + needs: build + + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + # Specify runner + deployment step + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action diff --git a/.github/workflows/compile-sketch.yml b/.github/workflows/compile-sketch.yml new file mode 100644 index 0000000..469a865 --- /dev/null +++ b/.github/workflows/compile-sketch.yml @@ -0,0 +1,126 @@ +name: Cross-compilation + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + compile-sketch: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + board: + # Uno + # https://github.com/arduino/ArduinoCore-avr/blob/master/boards.txt + - fqbn: arduino:avr:mega + # platforms: | + name: arduino:avr + source-url: https://downloads.arduino.cc/packages/package_index.json + + # ESP32 + # https://github.com/espressif/arduino-esp32/blob/master/boards.txt + - fqbn: esp32:esp32:esp32 + # platforms: | + name: esp32:esp32 + source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json + + # ESP32-S2 + # https://github.com/espressif/arduino-esp32/blob/master/boards.txt + - fqbn: esp32:esp32:esp32s2 + # platforms: | + name: esp32:esp32 + source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json + + # ESP32-C3 + # https://github.com/espressif/arduino-esp32/blob/master/boards.txt + - fqbn: esp32:esp32:esp32c3 + # platforms: | + name: esp32:esp32 + source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json + + # Artemis / Apollo3 + # https://github.com/sparkfun/Arduino_Apollo3/blob/main/boards.txt + - fqbn: SparkFun:apollo3:sfe_artemis_atp + # platforms: | + name: SparkFun:apollo3 + source-url: https://raw.githubusercontent.com/sparkfun/Arduino_Apollo3/master/package_sparkfun_apollo3_index.json + + # ESP8266 + # https://github.com/esp8266/Arduino/blob/master/boards.txt + - fqbn: esp8266:esp8266:thingdev + # platforms: | + name: esp8266:esp8266 + source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json + + # SAMD21 + # https://github.com/arduino/ArduinoCore-samd/blob/master/boards.txt + - fqbn: arduino:samd:mkr1000 + # platforms: | + name: arduino:samd + source-url: https://downloads.arduino.cc/packages/package_index.json + + # Nano BLE 33 / nRF52840 + # https://github.com/arduino/ArduinoCore-mbed/blob/master/boards.txt + - fqbn: arduino:mbed:nano33ble + # platforms: | + name: arduino:mbed + source-url: https://downloads.arduino.cc/packages/package_index.json + + # RP2040 + # https://github.com/arduino/ArduinoCore-mbed/blob/master/boards.txt + - fqbn: rp2040:rp2040:sparkfun_promicrorp2040 + # platforms: | + name: rp2040:rp2040 + source-url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json + + # RP2350 + # https://github.com/arduino/ArduinoCore-mbed/blob/master/boards.txt + - fqbn: rp2040:rp2040:sparkfun_promicrorp2350 + # platforms: | + name: rp2040:rp2040 + source-url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json + + # STM32 + # https://github.com/arduino/ArduinoCore-mbed/blob/master/boards.txt + - fqbn: STMicroelectronics:stm32:GenF4 + # platforms: | + name: STMicroelectronics:stm32 + source-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Branch name + run: + echo running on branch ${GITHUB_REF##*/} + + # Setup Arduino command line - install esp32 and all the libs flux needs + - name: Arduino - Install and setup the Arduino CLI + uses: arduino/setup-arduino-cli@v2 + + - name: Arduino - Start config file + run: arduino-cli config init --additional-urls ${{ matrix.board.source-url}} + + - name: Arduino - Update index + run: arduino-cli core update-index + + - name: Arduino - Install platform + run: arduino-cli core install ${{ matrix.board.name}} + + - name: Arduino - Install libraries + run: | + arduino-cli config set library.enable_unsafe_install true + arduino-cli version + arduino-cli lib install 'SparkFun Toolkit' + + - name: Compile Sketch + run: arduino-cli compile --fqbn ${{ matrix.board.fqbn }} examples/Example1_getLux --library . + + # outputs: + # report-artifact-name: ${{ steps.report-artifact-name.outputs.report-artifact-name }} diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..a8d0052 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "docs/doxygen/doxygen-awesome-css"] + path = docs/doxygen/doxygen-awesome-css + url = https://github.com/jothepro/doxygen-awesome-css.git diff --git a/LICENSE.md b/LICENSE.md index 91e99ef..f618c0e 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,40 +1,6 @@ -SparkFun License Information -============================ +MIT License -SparkFun uses two different licenses for our files — one for hardware and one for code. - -Hardware ---------- - -**SparkFun hardware is released under [Creative Commons Share-alike 4.0 International](http://creativecommons.org/licenses/by-sa/4.0/).** - -Note: This is a human-readable summary of (and not a substitute for) the [license](http://creativecommons.org/licenses/by-sa/4.0/legalcode). - -You are free to: - -Share — copy and redistribute the material in any medium or format -Adapt — remix, transform, and build upon the material -for any purpose, even commercially. -The licensor cannot revoke these freedoms as long as you follow the license terms. -Under the following terms: - -Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. -ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. -No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. -Notices: - -You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation. -No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material. - - -Code --------- - -**SparkFun code, firmware, and software is released under the MIT License(http://opensource.org/licenses/MIT).** - -The MIT License (MIT) - -Copyright (c) 2021 SparkFun Electronics +Copyright (c) 2025 SparkFun Electronics Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -52,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/README.md b/README.md index 4d4493b..e18a61c 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,55 @@ -SparkFun VEML7700 Arduino Library -============================== + -[](https://www.sparkfun.com/products/18981) +# SparkFun Ambient Light Sensor - VEML7700 Arduino Library -[*SparkX Ambient Light Sensor - VEML7700 (Qwiic) (SPX-18981)*](https://www.sparkfun.com/products/18981) +SparkFun Ambient Light Sensor - VEML7700 - AS7343 (QWIIC) -The Vishay Semiconductors VEML7700 is a high accuracy ambient light sensor with 16-bit resolution in a miniature transparent package. It includes a high sensitive photo diode, a low noise amplifier, a 16-bit A/D converter and supports the I2C bus communication interface. - -This library handles the initialization and configuration of the sensor, and monitoring of the ambient light level. + + + + + + -## Repository Contents -* **/examples** - Example sketches for the library (.ino). Run these from the Arduino IDE. -* **/src** - Source files for the library (.cpp, .h). -* **keywords.txt** - Keywords from this library that will be highlighted in the Arduino IDE. -* **library.properties** - General library properties for the Arduino package manager. -* **LICENSE.md** - Contains the license information. +This library provides full access to the functions of the VEML7700 Ambient Light Sensor through an I2C connection using the SparkFun Qwiic connectors and cables. + +### Supported Products +This library is intended for use with the following SparkFun Product - available at [www.sparkfun.com](https://www.sparkfun.com). + +| Product | Description| +|--|--| +|[SparkFun Ambient Light Sensor - VEML7700 (Qwiic)](https://www.sparkfun.com/sparkfun-ambient-light-sensor-veml7700-qwiic.html) | The SparkFun Qwiic VEML7700 Ambient Light Sensor provides accurate, 16-bit ambient light readings from 0 to 167,000 lux via the I2C interface. This miniature sensor (6.8mm x 3.0mm x 2.5mm) features a high-sensitivity photodiode, a low-noise amplifier, and a 16-bit analog-to-digital (A/D) converter. Its unshifted 7-bit I2C address is 0x10.| ## Documentation -- **/docs** - HTML documentation generated with [Doxygen](https://www.doxygen.nl/index.html). Open [**GitHub Pages**](https://sparkfun.github.io/SparkFun_VEML7700_Arduino_Library/) to view the documentation. -- **[Installing an Arduino Library Guide](https://learn.sparkfun.com/tutorials/installing-an-arduino-library)** - Basic information on how to install an Arduino library. +|Reference | Description | +|---|---| +|[Library Documentation](https://docs.sparkfun.com/SparkFun_VEML7700_Arduino_Library/)| The full documentation and API for this Arduino library| +|[SparkFun Ambient Light Sensor - VEML7700 (Qwiic)](https://github.com/sparkfun/SparkFun_Ambient_Light_Sensor-VEML7700)| Hardware GitHub Repository| +|[Hook Up Guide - SparkFun Ambient Light Sensor - VEML7700 (Qwiic)](https://docs.sparkfun.com/SparkFun_Ambient_Light_Sensor-VEML7700/introduction/) | Hardware Overview and Quick Start for the Ambient Light Sensor - VEML7700| +|[SparkFun Ambient Light Sensor - VEML7700 (Qwiic)](https://github.com/sparkfun/SparkFun_VEML7700_Arduino_Library)| Arduino Library - GitHub Repository| +|[VEML7700 Datasheet](https://cdn.sparkfun.com/assets/a/2/b/a/4/VEML7700_Datasheet.pdf) | Datasheet for the VEML7700 IC| +|[Installing an Arduino Library Guide](https://learn.sparkfun.com/tutorials/installing-an-arduino-library)| Basic information on how to install an Arduino library| -## Products That Use This Library +## Examples -* [SPX-18976](https://www.sparkfun.com/products/18976) - smôl Environmental Peripheral Board -* [SPX-18981](https://www.sparkfun.com/products/18981) - Ambient Light Sensor - VEML7700 (Qwiic) +The following examples are provided with the library + +| Example | Description | +|---|---| +|[Read LUX Value](examples/Example1_getLux/Example1_getLux.ino)| Take basic readings from the sensor - read the currently detect LUX value.| +|[Change Settings](examples/Example2_changeSettings/Example2_changeSettings.ino)| Change the operational settings of the sensor| +|[Threshold Settings](examples/Example3_threshold/Example3_threshold.ino)| Set threshold values and check for threshold triggered interrupts.| +|[Power Settomgs](examples/Example4_shutDown/Example4_shutDown.ino)| Shows how to shutdown and power up the sensor.| +|[Production Test](examples/Example5_ProductionTest/Example5_ProductionTest.ino)| Test used during board production | -## License Information -This product is _**open source**_! -Please use, reuse, and modify these files as you see fit. Please maintain attribution to SparkFun Electronics and release anything derivative under the same license. -Distributed as-is; no warranty is given. +## License Information + +This product is ***open source***! + +This product is licensed using the [MIT Open Source License](https://opensource.org/license/mit). -- Your friends at SparkFun. diff --git a/docs/_spark_fun___v_e_m_l7700___arduino___library_8h.html b/docs/_spark_fun___v_e_m_l7700___arduino___library_8h.html deleted file mode 100644 index e07d1b4..0000000 --- a/docs/_spark_fun___v_e_m_l7700___arduino___library_8h.html +++ /dev/null @@ -1,305 +0,0 @@ - - -
- - - - -
- SparkFun_VEML7700_Arduino_Library
-
- |
-
#include <Arduino.h>
#include <Wire.h>
Go to the source code of this file.
--Classes | |
class | VEML7700 |
-Macros | |
#define | VEML7700_I2C_ADDRESS 0x10 |
-Typedefs | |
-typedef uint16_t | VEML7700_t |
-Enumerations | |
enum | VEML7700_error_t { - VEML7700_ERROR_READ = -4 -, VEML7700_ERROR_WRITE = -3 -, VEML7700_ERROR_INVALID_ADDRESS = -2 -, VEML7700_ERROR_UNDEFINED = -1 -, - VEML7700_ERROR_SUCCESS = 1 - - } |
enum | VEML7700_sensitivity_mode_t { - VEML7700_SENSITIVITY_x1 -, VEML7700_SENSITIVITY_x2 -, VEML7700_SENSITIVITY_x1_8 -, VEML7700_SENSITIVITY_x1_4 -, - VEML7700_SENSITIVITY_INVALID - - } |
enum | VEML7700_integration_time_t { - VEML7700_INTEGRATION_25ms -, VEML7700_INTEGRATION_50ms -, VEML7700_INTEGRATION_100ms -, VEML7700_INTEGRATION_200ms -, - VEML7700_INTEGRATION_400ms -, VEML7700_INTEGRATION_800ms -, VEML7700_INTEGRATION_INVALID - - } |
enum | VEML7700_persistence_protect_t { - VEML7700_PERSISTENCE_1 -, VEML7700_PERSISTENCE_2 -, VEML7700_PERSISTENCE_4 -, VEML7700_PERSISTENCE_8 -, - VEML7700_PERSISTENCE_INVALID - - } |
enum | VEML7700_interrupt_enable_t { VEML7700_INT_DISABLE -, VEML7700_INT_ENABLE -, VEML7700_INT_INVALID - } |
enum | VEML7700_interrupt_status_t { - VEML7700_INT_STATUS_NONE -, VEML7700_INT_STATUS_HIGH -, VEML7700_INT_STATUS_LOW -, VEML7700_INT_STATUS_BOTH -, - VEML7700_INT_STATUS_INVALID - - } |
enum | VEML7700_shutdown_t { VEML7700_POWER_ON -, VEML7700_SHUT_DOWN -, VEML7700_SHUTDOWN_INVALID - } |
-Variables | |
-const VEML7700_error_t | VEML7700_SUCCESS = VEML7700_ERROR_SUCCESS |
SparkFun VEML7700 Ambient Light Sensor Arduino Library
-This library facilitates communication with the VEML7700 over I2C.
-Want to support open source hardware? Buy a board from SparkFun!
-SparkX smôl Environmental Peripheral Board (SPX-18976): https://www.sparkfun.com/products/18976
This library was written by: Paul Clark SparkFun Electronics November 4th 2021
-Please see LICENSE.md for the license information
-#define VEML7700_I2C_ADDRESS 0x10 | -
VEML7700 I2C address
- -enum VEML7700_error_t | -
VEML7700 error code returns
- -enum VEML7700_integration_time_t | -
ALS integration time setting Note: these are defined here in simple sequential order. The actual register settings are defined in VEML7700_config_integration_time_t
- -enum VEML7700_interrupt_enable_t | -
ALS interrupt enable setting
- -enum VEML7700_interrupt_status_t | -
ALS interrupt status, logical OR of the crossing low and high thrteshold INT triggers
- -enum VEML7700_persistence_protect_t | -
ALS persistence protect number setting
- -enum VEML7700_sensitivity_mode_t | -
Sensitivity mode selection
- -enum VEML7700_shutdown_t | -
ALS shut down setting
- -
- SparkFun_VEML7700_Arduino_Library
-
- |
-
- SparkFun_VEML7700_Arduino_Library
-
- |
-
CVEML7700 |
- SparkFun_VEML7700_Arduino_Library
-
- |
-
This is the complete list of members for VEML7700, including all inherited members.
-
- SparkFun_VEML7700_Arduino_Library
-
- |
-
#include <SparkFun_VEML7700_Arduino_Library.h>
-Public Member Functions | |
- | VEML7700 () |
Class to communicate with the VEML7700. | |
bool | begin (TwoWire &wirePort=Wire) |
Begin communication with the VEML7700. More... | |
void | enableDebugging (Stream &debugPort=Serial) |
Enable debug messages on the chosen Serial port (Stream) More... | |
-void | disableDebugging () |
Disable debug messages. | |
bool | isConnected () |
Check that the VEML7700 is awake and communicating. More... | |
VEML7700_error_t | setShutdown (VEML7700_shutdown_t) |
Set the VEML7700's shut down setting (ALS_SD) More... | |
-VEML7700_error_t | powerOn () |
-VEML7700_error_t | shutdown () |
VEML7700_shutdown_t | getShutdown () |
Get the VEML7700's shut down setting (ALS_SD) More... | |
VEML7700_error_t | setInterruptEnable (VEML7700_interrupt_enable_t ie) |
Set the VEML7700's interrupt enable setting (ALS_INT_EN) More... | |
VEML7700_error_t | getInterruptEnable (VEML7700_interrupt_enable_t *ie) |
Get the VEML7700's interrupt enable setting (ALS_INT_EN) More... | |
VEML7700_interrupt_enable_t | getInterruptEnable () |
Get the VEML7700's interrupt enable setting (ALS_INT_EN) More... | |
VEML7700_error_t | setPersistenceProtect (VEML7700_persistence_protect_t pp) |
Set the VEML7700's persistence protect number setting (ALS_PERS) More... | |
VEML7700_error_t | getPersistenceProtect (VEML7700_persistence_protect_t *pp) |
Get the VEML7700's persistence protect number setting (ALS_PERS) More... | |
VEML7700_persistence_protect_t | getPersistenceProtect () |
Get the VEML7700's persistence protect number setting (ALS_PERS) More... | |
-const char * | getPersistenceProtectStr () |
Get the VEML7700's persistence protect number setting (ALS_PERS) as printable text. | |
VEML7700_error_t | setIntegrationTime (VEML7700_integration_time_t it) |
Set the VEML7700's integration time setting (ALS_IT) -Note: these are defined here in simple sequential order -The actual register settings are defined in VEML7700_config_integration_time_t. More... | |
VEML7700_error_t | getIntegrationTime (VEML7700_integration_time_t *it) |
Get the VEML7700's integration time setting (ALS_IT) More... | |
VEML7700_integration_time_t | getIntegrationTime () |
Get the VEML7700's integration time setting (ALS_IT) More... | |
-const char * | getIntegrationTimeStr () |
Get the VEML7700's integration time setting (ALS_IT) as printable text. | |
VEML7700_error_t | setSensitivityMode (VEML7700_sensitivity_mode_t sm) |
Set the VEML7700's sensitivity mode selection (ALS_SM) More... | |
VEML7700_error_t | getSensitivityMode (VEML7700_sensitivity_mode_t *sm) |
Get the VEML7700's sensitivity mode selection (ALS_SM) More... | |
VEML7700_sensitivity_mode_t | getSensitivityMode () |
Get the VEML7700's sensitivity mode selection (ALS_SM) More... | |
-const char * | getSensitivityModeStr () |
Get the VEML7700's sensitivity mode selection (ALS_SM) as printable text. | |
VEML7700_error_t | setHighThreshold (uint16_t threshold) |
Set the VEML7700's ALS high threshold window setting (ALS_WH) More... | |
VEML7700_error_t | getHighThreshold (uint16_t *threshold) |
Get the VEML7700's ALS high threshold window setting (ALS_WH) More... | |
uint16_t | getHighThreshold () |
Get the VEML7700's ALS high threshold window setting (ALS_WH) More... | |
VEML7700_error_t | setLowThreshold (uint16_t threshold) |
Set the VEML7700's ALS low threshold window setting (ALS_WL) More... | |
VEML7700_error_t | getLowThreshold (uint16_t *threshold) |
Get the VEML7700's ALS low threshold window setting (ALS_WL) More... | |
uint16_t | getLowThreshold () |
Get the VEML7700's ALS low threshold window setting (ALS_WL) More... | |
VEML7700_error_t | getAmbientLight (uint16_t *ambient) |
Get the VEML7700's ambient light sensor data (ALS) More... | |
uint16_t | getAmbientLight () |
Get the VEML7700's ambient light sensor data (ALS) More... | |
VEML7700_error_t | getWhiteLevel (uint16_t *whiteLevel) |
Get the VEML7700's white level data (WHITE) More... | |
uint16_t | getWhiteLevel () |
Get the VEML7700's white level data (WHITE) More... | |
VEML7700_error_t | getLux (float *lux) |
Read the sensor data and calculate the lux. More... | |
float | getLux () |
Read the sensor data and calculate the lux. More... | |
VEML7700_error_t | getInterruptStatus (VEML7700_interrupt_status_t *status) |
Read the VEML7700's interrupt status register -Note: reading the interrupt status register clears the interrupts. - So, we need to check both interrupt flags in a single read. More... | |
VEML7700_interrupt_status_t | getInterruptStatus () |
Read the VEML7700's interrupt status register -Note: reading the interrupt status register clears the interrupts. - So, we need to check both interrupt flags in a single read. More... | |
Communication interface for the VEML7700
-bool VEML7700::begin | -( | -TwoWire & | -wirePort = Wire | ) | -- |
Begin communication with the VEML7700.
-Begin the VEML7700. Default to Wire
-wirePort | -The TwoWire (I2C) port used to communicate with the sensor. -Default is Wire. |
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.
- -void VEML7700::enableDebugging | -( | -Stream & | -debugPort = Serial | ) | -- |
Enable debug messages on the chosen Serial port (Stream)
-Enable debug messages. Default to Serial
-debugPort | -The Serial port (Stream) the debug messages will be printed to. -Default is Serial. |
uint16_t VEML7700::getAmbientLight | -( | -) | -- |
Get the VEML7700's ambient light sensor data (ALS)
-VEML7700_error_t VEML7700::getAmbientLight | -( | -uint16_t * | -ambient | ) | -- |
Get the VEML7700's ambient light sensor data (ALS)
-Read the sensor data
-ambient | -Will be set to the ambient level on return |
uint16_t VEML7700::getHighThreshold | -( | -) | -- |
Get the VEML7700's ALS high threshold window setting (ALS_WH)
-VEML7700_error_t VEML7700::getHighThreshold | -( | -uint16_t * | -threshold | ) | -- |
Get the VEML7700's ALS high threshold window setting (ALS_WH)
-threshold | -Will be set to the threshold setting on return |
VEML7700_integration_time_t VEML7700::getIntegrationTime | -( | -) | -- |
Get the VEML7700's integration time setting (ALS_IT)
-VEML7700_error_t VEML7700::getIntegrationTime | -( | -VEML7700_integration_time_t * | -it | ) | -- |
Get the VEML7700's integration time setting (ALS_IT)
-it | -Will be set to the intergration time setting on return |
VEML7700_interrupt_enable_t VEML7700::getInterruptEnable | -( | -) | -- |
Get the VEML7700's interrupt enable setting (ALS_INT_EN)
-VEML7700_error_t VEML7700::getInterruptEnable | -( | -VEML7700_interrupt_enable_t * | -ie | ) | -- |
Get the VEML7700's interrupt enable setting (ALS_INT_EN)
-ie | -Will be set to the interrupt enable setting on return |
VEML7700_interrupt_status_t VEML7700::getInterruptStatus | -( | -) | -- |
Read the VEML7700's interrupt status register
-Note: reading the interrupt status register clears the interrupts.
- So, we need to check both interrupt flags in a single read.
VEML7700_error_t VEML7700::getInterruptStatus | -( | -VEML7700_interrupt_status_t * | -status | ) | -- |
Read the VEML7700's interrupt status register
-Note: reading the interrupt status register clears the interrupts.
- So, we need to check both interrupt flags in a single read.
Note: reading the interrupt status register clears the interrupts. So, we need to check both interrupt flags in a single read.
-status | -Will be set to the logical OR of ALS_IF_L and ALS_IF_H on return -Possible values are: -VEML7700_INT_STATUS_NONE -VEML7700_INT_STATUS_HIGH -VEML7700_INT_STATUS_LOW -VEML7700_INT_STATUS_BOTH -If an I2C error occurred, status will be: -VEML7700_INT_STATUS_INVALID |
uint16_t VEML7700::getLowThreshold | -( | -) | -- |
Get the VEML7700's ALS low threshold window setting (ALS_WL)
-VEML7700_error_t VEML7700::getLowThreshold | -( | -uint16_t * | -threshold | ) | -- |
Get the VEML7700's ALS low threshold window setting (ALS_WL)
-threshold | -Will be set to the threshold setting on return |
float VEML7700::getLux | -( | -) | -- |
Read the sensor data and calculate the lux.
-VEML7700_error_t VEML7700::getLux | -( | -float * | -lux | ) | -- |
Read the sensor data and calculate the lux.
-lux | -Will be set to the lux on return |
First, we need to extract the correct resolution from the VEML7700_LUX_RESOLUTION gain and integration time look up table. Let's begin by reading the gain (sensitivity) and integration time.
-Now we can extract the correct resolution from the look up table.
-Now we read the ambient level and multiply it by the resolution
- -VEML7700_persistence_protect_t VEML7700::getPersistenceProtect | -( | -) | -- |
Get the VEML7700's persistence protect number setting (ALS_PERS)
-VEML7700_error_t VEML7700::getPersistenceProtect | -( | -VEML7700_persistence_protect_t * | -pp | ) | -- |
Get the VEML7700's persistence protect number setting (ALS_PERS)
-pp | -Will be set to the persistence protect number on return |
VEML7700_sensitivity_mode_t VEML7700::getSensitivityMode | -( | -) | -- |
Get the VEML7700's sensitivity mode selection (ALS_SM)
-VEML7700_error_t VEML7700::getSensitivityMode | -( | -VEML7700_sensitivity_mode_t * | -sm | ) | -- |
Get the VEML7700's sensitivity mode selection (ALS_SM)
-sm | -Will be set to the sensitivity mode selection on return |
VEML7700_shutdown_t VEML7700::getShutdown | -( | -) | -- |
Get the VEML7700's shut down setting (ALS_SD)
-uint16_t VEML7700::getWhiteLevel | -( | -) | -- |
Get the VEML7700's white level data (WHITE)
-VEML7700_error_t VEML7700::getWhiteLevel | -( | -uint16_t * | -whiteLevel | ) | -- |
Get the VEML7700's white level data (WHITE)
-whiteLevel | -Will be set to the white level on return |
boolean VEML7700::isConnected | -( | -) | -- |
VEML7700_error_t VEML7700::setHighThreshold | -( | -uint16_t | -threshold | ) | -- |
Set the VEML7700's ALS high threshold window setting (ALS_WH)
-threshold | -The threshold setting: 0x0000 to 0xFFFF |
VEML7700_error_t VEML7700::setIntegrationTime | -( | -VEML7700_integration_time_t | -it | ) | -- |
Set the VEML7700's integration time setting (ALS_IT)
-Note: these are defined here in simple sequential order
-The actual register settings are defined in VEML7700_config_integration_time_t.
it | -The integration time setting. Possible values are: -VEML7700_INTEGRATION_25ms -VEML7700_INTEGRATION_50ms -VEML7700_INTEGRATION_100ms -VEML7700_INTEGRATION_200ms -VEML7700_INTEGRATION_400ms -VEML7700_INTEGRATION_800ms |
VEML7700_error_t VEML7700::setInterruptEnable | -( | -VEML7700_interrupt_enable_t | -ie | ) | -- |
Set the VEML7700's interrupt enable setting (ALS_INT_EN)
-ie | -The interrupt enable setting. Possible values are: -VEML7700_INT_DISABLE -VEML7700_INT_ENABLE |
VEML7700_error_t VEML7700::setLowThreshold | -( | -uint16_t | -threshold | ) | -- |
Set the VEML7700's ALS low threshold window setting (ALS_WL)
-threshold | -The threshold setting: 0x0000 to 0xFFFF |
VEML7700_error_t VEML7700::setPersistenceProtect | -( | -VEML7700_persistence_protect_t | -pp | ) | -- |
Set the VEML7700's persistence protect number setting (ALS_PERS)
-pp | -The persistence protect setting. Possible values are: -VEML7700_PERSISTENCE_1 -VEML7700_PERSISTENCE_2 -VEML7700_PERSISTENCE_4 -VEML7700_PERSISTENCE_8 |
VEML7700_error_t VEML7700::setSensitivityMode | -( | -VEML7700_sensitivity_mode_t | -sm | ) | -- |
Set the VEML7700's sensitivity mode selection (ALS_SM)
-it | -The sensitivity mode selection. Possible values are: -VEML7700_SENSITIVITY_x1 -VEML7700_SENSITIVITY_x2 -VEML7700_SENSITIVITY_x1_8 -VEML7700_SENSITIVITY_x1_4 |
VEML7700_error_t VEML7700::setShutdown | -( | -VEML7700_shutdown_t | -sd | ) | -- |
Set the VEML7700's shut down setting (ALS_SD)
-Configuration controls
-sd | -The shut down setting. Possible values are: -VEML7700_POWER_ON -VEML7700_SHUT_DOWN |
- SparkFun_VEML7700_Arduino_Library
-
- |
-
- SparkFun_VEML7700_Arduino_Library
-
- |
-
-Files | |
file | SparkFun_VEML7700_Arduino_Library.h [code] |
+ $projectname
+ $projectnumber
+
+
+ $projectbrief
+ |
+
+
+
+
+ $projectbrief
+ |
+
+
+
+
+ $searchbox | + + +
- SparkFun_VEML7700_Arduino_Library
-
- |
-
▼ src | |
SparkFun_VEML7700_Arduino_Library.h |
- SparkFun_VEML7700_Arduino_Library
-
- |
-
- SparkFun_VEML7700_Arduino_Library
-
- |
-
- SparkFun_VEML7700_Arduino_Library
-
- |
-
- SparkFun_VEML7700_Arduino_Library
-
- |
-
- SparkFun_VEML7700_Arduino_Library
-
- |
-
- SparkFun_VEML7700_Arduino_Library
-
- |
-
This library facilitates communication with the VEML7700 over I2C.
-Want to support open source hardware? Buy a board from SparkFun!
-SparkX smôl Environmental Peripheral Board (SPX-18976): https://www.sparkfun.com/products/18976
This library was written by: Paul Clark SparkFun Electronics November 4th 2021
-MIT: please see LICENSE.md for the full license information
-