Skip to content

Move main to develop -- synch the branches #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Jul 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
dd7d8fd
update to new version needs
gigapod Jul 10, 2025
eec243e
initial refactor of the library - not tested, not even compiled
gigapod Jul 10, 2025
5721ab4
compiles and runs, but not valid yet
gigapod Jul 11, 2025
4e26ab2
I2C needed stop bit to false
gigapod Jul 12, 2025
1b56a53
remove debug statements
gigapod Jul 12, 2025
03de902
cleanup, move to doxygen comments for methods
gigapod Jul 12, 2025
7453827
update method call
gigapod Jul 12, 2025
a7ab46c
cleanup - comments
gigapod Jul 12, 2025
57e69a9
add standard suite of actions for our library - compile, docs, post a…
gigapod Jul 12, 2025
6f9cd15
moving to our updated doxygen schema
gigapod Jul 12, 2025
b27afc4
put in place the current doxygen setup for sparkfun repos
gigapod Jul 12, 2025
410f630
moved to different methodology
gigapod Jul 12, 2025
9e44b89
modern banner
gigapod Jul 12, 2025
e739296
example does not fit with how the toolkit works
gigapod Jul 12, 2025
6187851
moving around the last example
gigapod Jul 12, 2025
f9ab6cb
fix product image - dooh
gigapod Jul 12, 2025
3db2d39
updated readme for the v2.0 of the library
gigapod Jul 12, 2025
bf140b8
updates to a) provide some level of backward compatablity with lib v1…
gigapod Jul 12, 2025
6919bb5
upgrade the threshold example; add additional backward compat support
gigapod Jul 12, 2025
b3146a5
update for v2.0 of library
gigapod Jul 12, 2025
b1dc4e2
update for v2.0 of library
gigapod Jul 12, 2025
7273e63
Merge pull request #1 from sparkfun/feature/move-to-toolkit
gigapod Jul 12, 2025
9a5c7ec
added casts to reg values in read/write calls - some platforms are no…
gigapod Jul 12, 2025
0d2925e
Merge pull request #2 from sparkfun/feature/move-to-toolkit
gigapod Jul 12, 2025
79efa70
fixo
gigapod Jul 12, 2025
e453570
change how reg ids are specified - just use constexpr and not enums, …
gigapod Jul 12, 2025
0922eb3
update for v2
gigapod Jul 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/add_issue_to_project.yml
Original file line number Diff line number Diff line change
@@ -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 }}
64 changes: 64 additions & 0 deletions .github/workflows/build-deploy-ghpages.yml
Original file line number Diff line number Diff line change
@@ -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
126 changes: 126 additions & 0 deletions .github/workflows/compile-sketch.yml
Original file line number Diff line number Diff line change
@@ -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://github.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://github.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://github.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://github.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 }}
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
40 changes: 3 additions & 37 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.
SOFTWARE.
63 changes: 40 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,55 @@
SparkFun VEML7700 Arduino Library
==============================
![SparkFun Ambient Light Sensor - VEML7700 Arduino Library](docs/images/gh-banner-2025-arduino-veml7700.png "SparkFun Ambient Light Sensor - VEML7700 Arduino Library]")

[![SparkX Ambient Light Sensor - VEML7700 (Qwiic) (SPX-18981)](https://cdn.sparkfun.com//assets/parts/1/8/5/5/5/18981-Ambient_Light_Sensor_-_VEML7700__Qwiic_-01.jpg)](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 I<sup>2</sup>C bus communication interface.

This library handles the initialization and configuration of the sensor, and monitoring of the ambient light level.
![License](https://img.shields.io/github/license/sparkfun/SparkFun_VEML7700_Arduino_Library)
![Release](https://img.shields.io/github/v/release/sparkfun/SparkFun_VEML7700_Arduino_Library)
![Release Date](https://img.shields.io/github/release-date/sparkfun/SparkFun_VEML7700_Arduino_Library)
![Documentation - build](https://img.shields.io/github/actions/workflow/status/sparkfun/SparkFun_VEML7700_Arduino_Library/build-deploy-ghpages.yml?label=doc%20build)
![Compile - Test](https://img.shields.io/github/actions/workflow/status/sparkfun/SparkFun_VEML7700_Arduino_Library/compile-sketch.yml?label=compile%20test)
![GitHub issues](https://img.shields.io/github/issues/sparkfun/SparkFun_VEML7700_Arduino_Library)

## 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.
Loading