The VCNL4010 class.
More...
#include <Adafruit_VCNL4010.h>
◆ begin()
Setups the I2C connection and tests that the sensor was found. If so, configures for 200mA IR current and 390.625 KHz.
- Parameters
-
addr | Optional I2C address (however, all chips have the same address!) |
theWire | Optional Wire object if your board has more than one I2C interface |
- Returns
- true if sensor was found, false if not
◆ getLEDcurrent()
uint8_t Adafruit_VCNL4010::getLEDcurrent |
( |
void |
| ) |
|
Get the LED current.
- Returns
- The value directly from the register. Each bit represents 10mA so 5 == 50mA
◆ setLEDcurrent()
void Adafruit_VCNL4010::setLEDcurrent |
( |
uint8_t |
current_10mA | ) |
|
Set the LED current.
- Parameters
-
current_10mA | Can be any value from 0 to 20, each number represents 10 mA, so if you set it to 5, its 50mA. Minimum is 0 (0 mA, off), max is 20 (200mA) |
◆ setFrequency()
Set the measurement signal frequency.
- Parameters
-
freq | Sets the measurement rate for proximity. Can be VCNL4010_1_95 (1.95 measurements/s), VCNL4010_3_90625 (3.9062 meas/s), VCNL4010_7_8125 (7.8125 meas/s), VCNL4010_16_625 (16.625 meas/s), VCNL4010_31_25 (31.25 meas/s), VCNL4010_62_5 (62.5 meas/s), VCNL4010_125 (125 meas/s) or VCNL4010_250 (250 measurements/s) |
◆ readProximity()
uint16_t Adafruit_VCNL4010::readProximity |
( |
void |
| ) |
|
Get proximity measurement.
- Returns
- Raw 16-bit reading value, will vary with LED current, unit-less!
◆ readAmbient()
uint16_t Adafruit_VCNL4010::readAmbient |
( |
void |
| ) |
|
Get ambient light measurement.
- Returns
- Raw 16-bit reading value, unit-less!
The documentation for this class was generated from the following files: