[P168] Fix VEML6030 support

This commit is contained in:
Ton Huisman
2024-06-21 23:29:16 +02:00
parent b888afd5e0
commit fcb99e7745
4 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -39,8 +39,8 @@ Adafruit_VEML7700::Adafruit_VEML7700(void) {}
* @param theWire An optional pointer to an I2C interface
* @return True if initialization was successful, otherwise false.
*/
bool Adafruit_VEML7700::begin(TwoWire *theWire) {
i2c_dev = new Adafruit_I2CDevice(VEML7700_I2CADDR_DEFAULT, theWire);
bool Adafruit_VEML7700::begin(int8_t i2cAddr, TwoWire *theWire) {
i2c_dev = new Adafruit_I2CDevice(i2cAddr, theWire);
if (!i2c_dev->begin()) {
return false;
+1 -1
View File
@@ -83,7 +83,7 @@ typedef enum {
class Adafruit_VEML7700 {
public:
Adafruit_VEML7700();
bool begin(TwoWire *theWire = &Wire);
bool begin(int8_t i2cAddr = VEML7700_I2CADDR_DEFAULT, TwoWire *theWire = &Wire);
void enable(bool enable);
bool enabled(void);
+1
View File
@@ -6,6 +6,7 @@
// #######################################################################################################
/**
* 2024-06-21 tonhuisman: Fix support for VEML6030, using by default the alternate I2C address, by modifying the VEML7700 library
* 2024-05-18 tonhuisman: Implement AutoLux feature, and Get Config Value for automatically determined gain and integration
* 2024-05-16 tonhuisman: Start plugin for VEML6030/VEML7700 I2C Light sensor, using a slightly adjusted Adafruit library:
* https://github.com/adafruit/Adafruit_VEML7700
+1 -1
View File
@@ -23,7 +23,7 @@ bool P168_data_struct::init(struct EventStruct *event) {
// - Read sensor serial number
if ((nullptr != veml) &&
veml->begin()) {
veml->begin(P168_I2C_ADDRESS)) {
// Set config & start sensor
veml->setGain(_als_gain);
veml->setIntegrationTime(_als_integration);