Skip to content

Commit f6b3c06

Browse files
committed
Initial commit
0 parents  commit f6b3c06

File tree

7 files changed

+1071
-0
lines changed

7 files changed

+1071
-0
lines changed

LICENSE.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
SparkFun License Information
2+
============================
3+
4+
SparkFun uses two different licenses for our files — one for hardware and one for code.
5+
6+
Hardware
7+
---------
8+
9+
**SparkFun hardware is released under [Creative Commons Share-alike 4.0 International](http://creativecommons.org/licenses/by-sa/4.0/).**
10+
11+
Note: This is a human-readable summary of (and not a substitute for) the [license](http://creativecommons.org/licenses/by-sa/4.0/legalcode).
12+
13+
You are free to:
14+
15+
Share — copy and redistribute the material in any medium or format
16+
Adapt — remix, transform, and build upon the material
17+
for any purpose, even commercially.
18+
The licensor cannot revoke these freedoms as long as you follow the license terms.
19+
Under the following terms:
20+
21+
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.
22+
ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
23+
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
24+
Notices:
25+
26+
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.
27+
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.
28+
29+
30+
Code
31+
--------
32+
33+
**SparkFun code, firmware, and software is released under the MIT License(http://opensource.org/licenses/MIT).**
34+
35+
The MIT License (MIT)
36+
37+
Copyright (c) 2021 SparkFun Electronics
38+
39+
Permission is hereby granted, free of charge, to any person obtaining a copy
40+
of this software and associated documentation files (the "Software"), to deal
41+
in the Software without restriction, including without limitation the rights
42+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
43+
copies of the Software, and to permit persons to whom the Software is
44+
furnished to do so, subject to the following conditions:
45+
46+
The above copyright notice and this permission notice shall be included in all
47+
copies or substantial portions of the Software.
48+
49+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
50+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
51+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
52+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
53+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
54+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
55+
SOFTWARE.

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
SparkFun VEML7700 Arduino Library
2+
==============================
3+
4+
[![SparkX smôl Environmental Peripheral Board (SPX-18976)]()](https://www.sparkfun.com/products/18976)
5+
6+
[*SparkX smôl Environmental Peripheral Board (SPX-18976)*](https://www.sparkfun.com/products/18976)
7+
8+
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.
9+
10+
This library handles the initialization and configuration of the sensor, and monitoring of the ambient light level.
11+
12+
## Repository Contents
13+
14+
* **/examples** - Example sketches for the library (.ino). Run these from the Arduino IDE.
15+
* **/src** - Source files for the library (.cpp, .h).
16+
* **keywords.txt** - Keywords from this library that will be highlighted in the Arduino IDE.
17+
* **library.properties** - General library properties for the Arduino package manager.
18+
* **LICENSE.md** - Contains the license information.
19+
20+
## Documentation
21+
22+
* **[Installing an Arduino Library Guide](https://learn.sparkfun.com/tutorials/installing-an-arduino-library)** - Basic information on how to install an Arduino library.
23+
24+
## Products That Use This Library
25+
26+
* [SPX-18976](https://www.sparkfun.com/products/18976)- smôl Environmental Peripheral Board
27+
28+
## License Information
29+
30+
This product is _**open source**_!
31+
32+
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.
33+
34+
Distributed as-is; no warranty is given.
35+
36+
- Your friends at SparkFun.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*!
2+
* @file Example1_getLux.ino
3+
*
4+
* This example was written by:
5+
* Paul Clark
6+
* SparkFun Electronics
7+
* November 4th 2021
8+
*
9+
* This example demonstrates how to initialize the VEML7700 and then get the ambient light lux.
10+
*
11+
* Want to support open source hardware? Buy a board from SparkFun!
12+
* <br>SparkX smôl Environmental Peripheral Board (SPX-18976): https://www.sparkfun.com/products/18976
13+
*
14+
* Please see LICENSE.md for the license information
15+
*
16+
*/
17+
18+
#include <SparkFun_VEML7700_Arduino_Library.h> // Click here to get the library: http://librarymanager/All#SparkFun_VEML7700
19+
20+
VEML7700 mySensor; // Create a VEML7700 object
21+
22+
void setup()
23+
{
24+
Serial.begin(115200);
25+
Serial.println(F("SparkFun VEML7700 Example"));
26+
27+
Wire.begin();
28+
29+
//mySensor.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial
30+
31+
// Begin the VEML7700 using the Wire I2C port
32+
// .begin will return true on success, or false on failure to communicate
33+
if (mySensor.begin() == false)
34+
{
35+
Serial.println("Unable to communicate with the VEML7700. Please check the wiring. Freezing...");
36+
while (1)
37+
;
38+
}
39+
40+
Serial.println(F("Lux:"));
41+
}
42+
43+
void loop()
44+
{
45+
Serial.println(mySensor.getLux(), 4); // Read the lux from the sensor and print it
46+
delay(250);
47+
}

keywords.txt

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#######################################
2+
# Syntax Coloring Map
3+
#######################################
4+
5+
#######################################
6+
# Datatypes (KEYWORD1)
7+
#######################################
8+
9+
SparkFun_VEML7700_Arduino_Library KEYWORD1
10+
VEML7700 KEYWORD1
11+
VEML7700_t KEYWORD1
12+
VEML7700_error_t KEYWORD1
13+
VEML7700_sensitivity_mode_t KEYWORD1
14+
VEML7700_integration_time_t KEYWORD1
15+
VEML7700_persistence_protect_t KEYWORD1
16+
VEML7700_interrupt_enable_t KEYWORD1
17+
VEML7700_shutdown_t KEYWORD1
18+
19+
#######################################
20+
# Methods and Functions (KEYWORD2)
21+
#######################################
22+
23+
begin KEYWORD2
24+
enableDebugging KEYWORD2
25+
disableDebugging KEYWORD2
26+
isConnected KEYWORD2
27+
setShutdown KEYWORD2
28+
powerOn KEYWORD2
29+
shutdown KEYWORD2
30+
getShutdown KEYWORD2
31+
setInterruptEnable KEYWORD2
32+
getInterruptEnable KEYWORD2
33+
setPersistenceProtect KEYWORD2
34+
getPersistenceProtect KEYWORD2
35+
setIntegrationTime KEYWORD2
36+
getIntegrationTime KEYWORD2
37+
setSensitivityMode KEYWORD2
38+
getSensitivityMode KEYWORD2
39+
setHighThreshold KEYWORD2
40+
getHighThreshold KEYWORD2
41+
setLowThreshold KEYWORD2
42+
getLowThreshold KEYWORD2
43+
getAmbientLight KEYWORD2
44+
getWhiteLevel KEYWORD2
45+
getLux KEYWORD2
46+
getHighInterruptStatus KEYWORD2
47+
getLowInterruptStatus KEYWORD2
48+
clearInterruptStatus KEYWORD2
49+
50+
#######################################
51+
# Constants (LITERAL1)
52+
#######################################
53+
54+
VEML7700_ERROR_READ LITERAL1
55+
VEML7700_ERROR_WRITE LITERAL1
56+
VEML7700_ERROR_INVALID_ADDRESS LITERAL1
57+
VEML7700_ERROR_UNDEFINED LITERAL1
58+
VEML7700_ERROR_SUCCESS LITERAL1
59+
VEML7700_SUCCESS| LITERAL1
60+
VEML7700_SENSITIVITY_x1 LITERAL1
61+
VEML7700_SENSITIVITY_x2 LITERAL1
62+
VEML7700_SENSITIVITY_x1_8 LITERAL1
63+
VEML7700_SENSITIVITY_x1_4 LITERAL1
64+
VEML7700_SENSITIVITY_INVALID LITERAL1
65+
VEML7700_INTEGRATION_25ms LITERAL1
66+
VEML7700_INTEGRATION_50ms LITERAL1
67+
VEML7700_INTEGRATION_100ms LITERAL1
68+
VEML7700_INTEGRATION_200ms LITERAL1
69+
VEML7700_INTEGRATION_400ms LITERAL1
70+
VEML7700_INTEGRATION_800ms LITERAL1
71+
VEML7700_INTEGRATION_INVALID LITERAL1
72+
VEML7700_PERSISTENCE_1 LITERAL1
73+
VEML7700_PERSISTENCE_2 LITERAL1
74+
VEML7700_PERSISTENCE_4 LITERAL1
75+
VEML7700_PERSISTENCE_8 LITERAL1
76+
VEML7700_PERSISTENCE_INVALID LITERAL1
77+
VEML7700_INT_DISABLE LITERAL1
78+
VEML7700_INT_ENABLE LITERAL1
79+
VEML7700_INT_INVALID LITERAL1
80+
VEML7700_POWER_ON LITERAL1
81+
VEML7700_SHUT_DOWN LITERAL1
82+
VEML7700_SHUTDOWN_INVALID LITERAL1

library.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=SparkFun VEML7700 Arduino Library
2+
version=1.0.0
3+
author=SparkFun Electronics <techsupport@sparkfun.com>
4+
maintainer=SparkFun Electronics <sparkfun.com>
5+
sentence=Library for the VEML7700 Ambient Light Sensor
6+
paragraph=An Arduino Library for the VEML7700 ambient light sensor. This library configures the sensor and reads the ambient light level.
7+
category=Sensors
8+
url=https://github.com/sparkfun/SparkFun_VEML7700_Arduino_Library
9+
architectures=*

0 commit comments

Comments
 (0)