mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-28 04:07:47 +00:00
[P168] Fix VEML6030 support
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user