Adafruit VEML7700 Arduino Library
Public Member Functions | List of all members
Adafruit_VEML7700 Class Reference

Class that stores state and functions for interacting with VEML7700 Temp Sensor. More...

#include <Adafruit_VEML7700.h>

Public Member Functions

 Adafruit_VEML7700 ()
 Instantiates a new VEML7700 class.
 
boolean begin (TwoWire *theWire=&Wire)
 Setups the hardware for talking to the VEML7700. More...
 
void enable (bool enable)
 Enable or disable the sensor. More...
 
bool enabled (void)
 Ask if the interrupt is enabled. More...
 
void interruptEnable (bool enable)
 Enable or disable the interrupt. More...
 
bool interruptEnabled (void)
 Ask if the interrupt is enabled. More...
 
void setPersistence (uint8_t pers)
 Set the ALS IRQ persistance setting. More...
 
uint8_t getPersistence (void)
 Get the ALS IRQ persistance setting. More...
 
void setIntegrationTime (uint8_t it)
 Set ALS integration time. More...
 
uint8_t getIntegrationTime (void)
 Get ALS integration time. More...
 
void setGain (uint8_t gain)
 Set ALS gain. More...
 
uint8_t getGain (void)
 Get ALS gain. More...
 
void powerSaveEnable (bool enable)
 Enable power save mode. More...
 
bool powerSaveEnabled (void)
 Check if power save mode is enabled. More...
 
void setPowerSaveMode (uint8_t mode)
 Assign the power save register data. More...
 
uint8_t getPowerSaveMode (void)
 Retrieve the power save register data. More...
 
void setLowThreshold (uint16_t value)
 Assign the low threshold register data. More...
 
uint16_t getLowThreshold (void)
 Retrieve the low threshold register data. More...
 
void setHighThreshold (uint16_t value)
 Assign the high threshold register data. More...
 
uint16_t getHighThreshold (void)
 Retrieve the high threshold register data. More...
 
uint16_t interruptStatus (void)
 Retrieve the interrupt status register data. More...
 
float readLux ()
 Read the calibrated lux value. See app note lux table on page 5. More...
 
uint16_t readALS ()
 Read the raw ALS data. More...
 
float readWhite ()
 Read the white light data. More...
 

Detailed Description

Class that stores state and functions for interacting with VEML7700 Temp Sensor.

Member Function Documentation

◆ begin()

boolean Adafruit_VEML7700::begin ( TwoWire *  theWire = &Wire)

Setups the hardware for talking to the VEML7700.

Parameters
theWireAn optional pointer to an I2C interface
Returns
True if initialization was successful, otherwise false.

◆ enable()

void Adafruit_VEML7700::enable ( bool  enable)

Enable or disable the sensor.

Parameters
enableThe flag to enable/disable

◆ enabled()

bool Adafruit_VEML7700::enabled ( void  )

Ask if the interrupt is enabled.

Returns
True if enabled, false otherwise

◆ interruptEnable()

void Adafruit_VEML7700::interruptEnable ( bool  enable)

Enable or disable the interrupt.

Parameters
enableThe flag to enable/disable

◆ interruptEnabled()

bool Adafruit_VEML7700::interruptEnabled ( void  )

Ask if the interrupt is enabled.

Returns
True if enabled, false otherwise

◆ setPersistence()

void Adafruit_VEML7700::setPersistence ( uint8_t  pers)

Set the ALS IRQ persistance setting.

Parameters
persPersistance constant, can be VEML7700_PERS_1, VEML7700_PERS_2, VEML7700_PERS_4 or VEML7700_PERS_8

◆ getPersistence()

uint8_t Adafruit_VEML7700::getPersistence ( void  )

Get the ALS IRQ persistance setting.

Returns
Persistance constant, can be VEML7700_PERS_1, VEML7700_PERS_2, VEML7700_PERS_4 or VEML7700_PERS_8

◆ setIntegrationTime()

void Adafruit_VEML7700::setIntegrationTime ( uint8_t  it)

Set ALS integration time.

Parameters
itCan be VEML7700_IT_100MS, VEML7700_IT_200MS, VEML7700_IT_400MS, VEML7700_IT_800MS, VEML7700_IT_50MS or VEML7700_IT_25MS

◆ getIntegrationTime()

uint8_t Adafruit_VEML7700::getIntegrationTime ( void  )

Get ALS integration time.

Returns
IT index, can be VEML7700_IT_100MS, VEML7700_IT_200MS, VEML7700_IT_400MS, VEML7700_IT_800MS, VEML7700_IT_50MS or VEML7700_IT_25MS

◆ setGain()

void Adafruit_VEML7700::setGain ( uint8_t  gain)

Set ALS gain.

Parameters
gainCan be VEML7700_GAIN_1, VEML7700_GAIN_2, VEML7700_GAIN_1_8 or VEML7700_GAIN_1_4

◆ getGain()

uint8_t Adafruit_VEML7700::getGain ( void  )

Get ALS gain.

Returns
Gain index, can be VEML7700_GAIN_1, VEML7700_GAIN_2, VEML7700_GAIN_1_8 or VEML7700_GAIN_1_4

◆ powerSaveEnable()

void Adafruit_VEML7700::powerSaveEnable ( bool  enable)

Enable power save mode.

Parameters
enableTrue if power save should be enabled

◆ powerSaveEnabled()

bool Adafruit_VEML7700::powerSaveEnabled ( void  )

Check if power save mode is enabled.

Returns
True if power save is enabled

◆ setPowerSaveMode()

void Adafruit_VEML7700::setPowerSaveMode ( uint8_t  mode)

Assign the power save register data.

Parameters
modeThe 16-bit data to write to VEML7700_ALS_POWER_SAVE

◆ getPowerSaveMode()

uint8_t Adafruit_VEML7700::getPowerSaveMode ( void  )

Retrieve the power save register data.

Returns
16-bit data from VEML7700_ALS_POWER_SAVE

◆ setLowThreshold()

void Adafruit_VEML7700::setLowThreshold ( uint16_t  value)

Assign the low threshold register data.

Parameters
valueThe 16-bit data to write to VEML7700_ALS_THREHOLD_LOW

◆ getLowThreshold()

uint16_t Adafruit_VEML7700::getLowThreshold ( void  )

Retrieve the low threshold register data.

Returns
16-bit data from VEML7700_ALS_THREHOLD_LOW

◆ setHighThreshold()

void Adafruit_VEML7700::setHighThreshold ( uint16_t  value)

Assign the high threshold register data.

Parameters
valueThe 16-bit data to write to VEML7700_ALS_THREHOLD_HIGH

◆ getHighThreshold()

uint16_t Adafruit_VEML7700::getHighThreshold ( void  )

Retrieve the high threshold register data.

Returns
16-bit data from VEML7700_ALS_THREHOLD_HIGH

◆ interruptStatus()

uint16_t Adafruit_VEML7700::interruptStatus ( void  )

Retrieve the interrupt status register data.

Returns
16-bit data from VEML7700_INTERRUPTSTATUS

◆ readLux()

float Adafruit_VEML7700::readLux ( )

Read the calibrated lux value. See app note lux table on page 5.

Returns
Floating point Lux data (ALS multiplied by 0.0576)

◆ readALS()

uint16_t Adafruit_VEML7700::readALS ( )

Read the raw ALS data.

Returns
16-bit data value from the ALS register

◆ readWhite()

float Adafruit_VEML7700::readWhite ( )

Read the white light data.

Returns
Floating point 'white light' data multiplied by 0.0576

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