Adafruit VL6180X Arduino Library
Public Member Functions | List of all members
Adafruit_VL6180X Class Reference

! Class for managing connection and state to a VL6180X sensor More...

#include <Adafruit_VL6180X.h>

Public Member Functions

 Adafruit_VL6180X ()
 Instantiates a new VL6180X class.
 
boolean begin (TwoWire *theWire=NULL)
 Initializes I2C interface, checks that VL6180X is found and resets chip. More...
 
uint8_t readRange (void)
 Single shot ranging. Be sure to check the return of readRangeStatus to before using the return value! More...
 
float readLux (uint8_t gain)
 Single shot lux measurement. More...
 
uint8_t readRangeStatus (void)
 Request ranging success/error message (retreive after ranging) More...
 

Detailed Description

! Class for managing connection and state to a VL6180X sensor

Member Function Documentation

◆ begin()

boolean Adafruit_VL6180X::begin ( TwoWire *  theWire = NULL)

Initializes I2C interface, checks that VL6180X is found and resets chip.

Parameters
theWireOptional pointer to I2C interface, &Wire is used by default
Returns
True if chip found and initialized, False otherwise

◆ readRange()

uint8_t Adafruit_VL6180X::readRange ( void  )

Single shot ranging. Be sure to check the return of readRangeStatus to before using the return value!

Returns
Distance in millimeters if valid

◆ readLux()

float Adafruit_VL6180X::readLux ( uint8_t  gain)

Single shot lux measurement.

Parameters
gainGain setting, one of VL6180X_ALS_GAIN_*
Returns
Lux reading

◆ readRangeStatus()

uint8_t Adafruit_VL6180X::readRangeStatus ( void  )

Request ranging success/error message (retreive after ranging)

Returns
One of possible VL6180X_ERROR_* values

The documentation for this class was generated from the following files: