21 #include <Adafruit_I2CDevice.h> 22 #include <Adafruit_I2CRegister.h> 25 #define VEML6075_ADDR (0x10) 26 #define VEML6075_REG_CONF (0x00) 27 #define VEML6075_REG_UVA (0x07) 28 #define VEML6075_REG_DARK (0x08) 29 #define VEML6075_REG_UVB (0x09) 30 #define VEML6075_REG_UVCOMP1 (0x0A) 31 #define VEML6075_REG_UVCOMP2 (0x0B) 32 #define VEML6075_REG_ID (0x0C) 34 #define VEML6075_DEFAULT_UVA_A_COEFF 2.22 35 #define VEML6075_DEFAULT_UVA_B_COEFF 1.33 36 #define VEML6075_DEFAULT_UVB_C_COEFF 2.95 37 #define VEML6075_DEFAULT_UVB_D_COEFF 1.74 38 #define VEML6075_DEFAULT_UVA_RESPONSE 0.001461 39 #define VEML6075_DEFAULT_UVB_RESPONSE 0.002591 82 bool highDynamic =
false,
bool forcedReads =
false,
83 TwoWire *theWire = &Wire);
94 void setCoefficients(
float UVA_A,
float UVA_B,
float UVA_C,
float UVA_D,
95 float UVA_response,
float UVB_response);
100 void readUVABI(
float *a,
float *b,
float *i);
105 void takeReading(
void);
107 uint16_t _read_delay;
110 float _uva_a, _uva_b, _uvb_c, _uvb_d, _uva_resp, _uvb_resp;
111 float _uva_calc, _uvb_calc;
115 Adafruit_I2CDevice *i2c_dev;
uint8_t UV_AF
Auto or forced.
Definition: Adafruit_VEML6075.h:62
uint16_t reg
The raw 16 bit register data.
Definition: Adafruit_VEML6075.h:68
void setHighDynamic(bool hd)
Sets whether to take readings in 'high dynamic' mode.
Definition: Adafruit_VEML6075.cpp:191
boolean begin(veml6075_integrationtime_t itime=VEML6075_100MS, bool highDynamic=false, bool forcedReads=false, TwoWire *theWire=&Wire)
setup and initialize communication with the hardware
Definition: Adafruit_VEML6075.cpp:65
uint8_t UV_TRIG
Trigger forced mode.
Definition: Adafruit_VEML6075.h:63
void readUVABI(float *a, float *b, float *i)
read the calibrated UVA & UVB band reading and calculate the approximate UV Index reading ...
Definition: Adafruit_VEML6075.cpp:329
bool getHighDynamic(void)
Gets whether to take readings in 'high dynamic' mode.
Definition: Adafruit_VEML6075.cpp:203
Adafruit_VEML6075()
constructor initializes default configuration value
Definition: Adafruit_VEML6075.cpp:45
uint8_t SD
Shut Down.
Definition: Adafruit_VEML6075.h:61
CMSIS style register bitfield for commands.
Definition: Adafruit_VEML6075.h:59
veml6075_integrationtime_t getIntegrationTime(void)
Get the time over which we sample UV data per read from the sensor.
Definition: Adafruit_VEML6075.cpp:177
float readUVA(void)
read the calibrated UVA band reading
Definition: Adafruit_VEML6075.cpp:293
uint8_t UV_IT
Integration Time.
Definition: Adafruit_VEML6075.h:65
Adafruit_I2CRegister * Config_Register
Chip config register.
Definition: Adafruit_VEML6075.h:102
bool getForcedMode(void)
Gets whether to take readings on request.
Definition: Adafruit_VEML6075.cpp:229
void shutdown(bool sd)
Shut down the sensor.
Definition: Adafruit_VEML6075.cpp:135
veml6075_integrationtime
integration time definitions
Definition: Adafruit_VEML6075.h:46
float readUVI(void)
Read and calculate the approximate UV Index reading.
Definition: Adafruit_VEML6075.cpp:315
uint8_t high_byte
unused
Definition: Adafruit_VEML6075.h:66
Class that stores state and functions for interacting with VEML6075 sensor IC.
Definition: Adafruit_VEML6075.h:77
float readUVB(void)
read the calibrated UVB band reading
Definition: Adafruit_VEML6075.cpp:304
enum veml6075_integrationtime veml6075_integrationtime_t
integration time definitions
void setCoefficients(float UVA_A, float UVA_B, float UVA_C, float UVA_D, float UVA_response, float UVB_response)
Set the UVI calculation coefficients, see datasheet for some example values. We use the default "no c...
Definition: Adafruit_VEML6075.cpp:118
void setForcedMode(bool flag)
Sets whether to take readings on request.
Definition: Adafruit_VEML6075.cpp:217
uint8_t UV_HD
High dynamic.
Definition: Adafruit_VEML6075.h:64
void setIntegrationTime(veml6075_integrationtime_t itime)
Set the time over which we sample UV data per read.
Definition: Adafruit_VEML6075.cpp:146