Skip to content

Commit 71adad1

Browse files
author
Elias Santistevan
committed
Adds remaining comments to second example
1 parent e8987cb commit 71adad1

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Examples/Example2_Light_Interrupt/Example2_Light_Interrupt.ino

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
/*
22
This example code will walk you through how to set the interrupts on the
3-
SparkFun VEML6030 Ambient Light Sensor.
3+
SparkFun VEML6030 Ambient Light Sensor. You can set both high and low
4+
thresholds as well as how many values must be below or above the threshold
5+
before an interrupt occurs. This example does require the interrupt pin on
6+
the product to be connected a pin on your micro-controller.
47
5-
SparkFun Electronics
8+
SparkFun Electronics
69
Author: Elias Santistevan
710
Date: July 2019
811
@@ -16,6 +19,7 @@
1619
#include <Wire.h>
1720
#include "SparkFun_VEML6030_Ambient_Light_Sensor.h"
1821

22+
// Close the address jumper on the product for addres 0x10.
1923
#define AL_ADDR 0x48
2024

2125
SparkFun_Ambient_Light light(AL_ADDR);
@@ -46,9 +50,6 @@ void setup(){
4650
Serial.begin(115200);
4751
pinMode(intPin, INPUT);
4852

49-
Serial.println(float(time));
50-
Serial.println(time);
51-
Serial.println(float("1"));
5253
if(light.begin())
5354
Serial.println("Ready to sense some light!");
5455
else
@@ -57,7 +58,7 @@ Serial.println(float("1"));
5758
// Again the gain and integration times determine the resolution of the lux
5859
// value, and give different ranges of possible light readings. Check out
5960
// hoookup guide for more info. The gain/integration time also affects
60-
// interrupt threshold settings so ALWAYS set these first.
61+
// interrupt threshold settings so ALWAYS set gain and time first.
6162
light.setGain(gain);
6263
light.setIntegTime(time);
6364

@@ -73,7 +74,8 @@ Serial.println(float("1"));
7374
light.setIntLowThresh(lowThresh);
7475
light.setIntHighThresh(highThresh);
7576
// Let's check that they were set correctly.
76-
// There are some rounding issues inherently.
77+
// There are some rounding issues inherently in the IC's design so your lux
78+
// may be one off.
7779
Serial.print("Low Threshold: ");
7880
long lowVal = light.readLowThresh();
7981
Serial.print(lowVal);

0 commit comments

Comments
 (0)