Line | |
---|
1 | #include <Wire.h>
|
---|
2 | #include "Adafruit_VCNL4010.h"
|
---|
3 |
|
---|
4 | Adafruit_VCNL4010 vcnl;
|
---|
5 |
|
---|
6 | void setup() {
|
---|
7 | Serial.begin(9600);
|
---|
8 | Serial.println("VCNL4010 test");
|
---|
9 |
|
---|
10 | if (! vcnl.begin()){
|
---|
11 | Serial.println("Sensor not found :(");
|
---|
12 | while (1);
|
---|
13 | }
|
---|
14 | Serial.println("Found VCNL4010");
|
---|
15 | }
|
---|
16 |
|
---|
17 |
|
---|
18 | void loop() {
|
---|
19 | Serial.print("Ambient: "); Serial.println(vcnl.readAmbient());
|
---|
20 | Serial.print("Proimity: "); Serial.println(vcnl.readProximity());
|
---|
21 | delay(100);
|
---|
22 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.