Skip to content

Commit d3cd109

Browse files
authored
Merge pull request #681 from adafruit/fixed-sen66
Fixed SEN66 CO2 overflow Merges #675 Closes #675 Fixes #678
2 parents d9455c3 + a5c4811 commit d3cd109

6 files changed

+363
-4
lines changed

Diff for: library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ paragraph=Arduino application for Adafruit.io WipperSnapper
77
category=Communication
88
url=https://github.com/adafruit/Adafruit_Wippersnapper_Arduino
99
architectures=*
10-
depends=Adafruit NeoPixel, Adafruit SPIFlash, ArduinoJson, Adafruit DotStar, Adafruit HDC302x, Adafruit INA219, Adafruit LTR329 and LTR303, Adafruit LTR390 Library, Adafruit MCP3421, Adafruit NAU7802 Library, Adafruit SleepyDog Library, Adafruit TMP117, Adafruit TinyUSB Library, Adafruit AHTX0, Adafruit BME280 Library, Adafruit BMP280 Library, Adafruit BMP3XX Library, Adafruit DPS310, Adafruit DS248x, Adafruit SCD30, Adafruit SGP30 Sensor, Adafruit SGP40 Sensor, Sensirion I2C SCD4x, Sensirion I2C SEN5X, arduino-sht, Adafruit Si7021 Library, Adafruit MQTT Library, Adafruit MS8607, Adafruit MCP9808 Library, Adafruit MCP9600 Library, Adafruit MPL115A2, Adafruit MPRLS Library, Adafruit TSL2591 Library, Adafruit_VL53L0X, Adafruit VL53L1X, STM32duino VL53L4CD, STM32duino VL53L4CX, Adafruit_VL6180X, Adafruit PM25 AQI Sensor, Adafruit VCNL4020 Library, Adafruit VCNL4040, Adafruit VCNL4200 Library, Adafruit VEML7700 Library, Adafruit LC709203F, Adafruit LPS2X, Adafruit LPS35HW, Adafruit seesaw Library, Adafruit BME680 Library, Adafruit MAX1704X, Adafruit ADT7410 Library, Adafruit HTS221, Adafruit HTU21DF Library, Adafruit HTU31D Library, Adafruit PCT2075, hp_BH1750, ENS160 - Adafruit Fork
10+
depends=Adafruit NeoPixel, Adafruit SPIFlash, ArduinoJson, Adafruit DotStar, Adafruit HDC302x, Adafruit INA219, Adafruit LTR329 and LTR303, Adafruit LTR390 Library, Adafruit MCP3421, Adafruit NAU7802 Library, Adafruit SleepyDog Library, Adafruit TMP117, Adafruit TinyUSB Library, Adafruit AHTX0, Adafruit BME280 Library, Adafruit BMP280 Library, Adafruit BMP3XX Library, Adafruit DPS310, Adafruit DS248x, Adafruit SCD30, Adafruit SGP30 Sensor, Adafruit SGP40 Sensor, Sensirion I2C SCD4x, Sensirion I2C SEN5X, Sensirion I2C SEN66, arduino-sht, Adafruit Si7021 Library, Adafruit MQTT Library, Adafruit MS8607, Adafruit MCP9808 Library, Adafruit MCP9600 Library, Adafruit MPL115A2, Adafruit MPRLS Library, Adafruit TSL2591 Library, Adafruit_VL53L0X, Adafruit VL53L1X, STM32duino VL53L4CD, STM32duino VL53L4CX, Adafruit_VL6180X, Adafruit PM25 AQI Sensor, Adafruit VCNL4020 Library, Adafruit VCNL4040, Adafruit VCNL4200 Library, Adafruit VEML7700 Library, Adafruit LC709203F, Adafruit LPS2X, Adafruit LPS35HW, Adafruit seesaw Library, Adafruit BME680 Library, Adafruit MAX1704X, Adafruit ADT7410 Library, Adafruit HTS221, Adafruit HTU21DF Library, Adafruit HTU31D Library, Adafruit PCT2075, hp_BH1750, ENS160 - Adafruit Fork

Diff for: platformio.ini

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ lib_deps =
8585
https://github.com/Sensirion/arduino-sht.git
8686
https://github.com/Sensirion/arduino-i2c-scd4x.git
8787
https://github.com/Sensirion/arduino-i2c-sen5x.git
88+
https://github.com/Sensirion/arduino-i2c-sen66.git
8889
https://github.com/adafruit/WiFiNINA.git
8990
https://github.com/Starmbi/hp_BH1750.git
9091
https://github.com/adafruit/Adafruit_TinyUSB_Arduino.git

Diff for: src/components/i2c/WipperSnapper_I2C.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,22 @@ bool WipperSnapper_Component_I2C::initI2CDevice(
600600
_sen5x->configureDriver(msgDeviceInitReq);
601601
drivers.push_back(_sen5x);
602602
WS_DEBUG_PRINTLN("SEN5X Initialized Successfully!");
603+
} else if ((strcmp("sen6x", msgDeviceInitReq->i2c_device_name) == 0) ||
604+
(strcmp("sen60", msgDeviceInitReq->i2c_device_name) == 0) ||
605+
(strcmp("sen63C", msgDeviceInitReq->i2c_device_name) == 0) ||
606+
(strcmp("sen65", msgDeviceInitReq->i2c_device_name) == 0) ||
607+
(strcmp("sen66", msgDeviceInitReq->i2c_device_name) == 0) ||
608+
(strcmp("sen68", msgDeviceInitReq->i2c_device_name) == 0)) {
609+
_sen6x = new WipperSnapper_I2C_Driver_SEN6X(this->_i2c, i2cAddress);
610+
if (!_sen6x->begin()) {
611+
WS_DEBUG_PRINTLN("ERROR: Failed to initialize SEN6X!");
612+
_busStatusResponse =
613+
wippersnapper_i2c_v1_BusResponse_BUS_RESPONSE_DEVICE_INIT_FAIL;
614+
return false;
615+
}
616+
_sen6x->configureDriver(msgDeviceInitReq);
617+
drivers.push_back(_sen6x);
618+
WS_DEBUG_PRINTLN("SEN6X Initialized Successfully!");
603619
} else if ((strcmp("sht40", msgDeviceInitReq->i2c_device_name) == 0) ||
604620
(strcmp("sht41", msgDeviceInitReq->i2c_device_name) == 0) ||
605621
(strcmp("sht45", msgDeviceInitReq->i2c_device_name) == 0)) {

Diff for: src/components/i2c/WipperSnapper_I2C.h

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
#include "drivers/WipperSnapper_I2C_Driver_SCD30.h"
5454
#include "drivers/WipperSnapper_I2C_Driver_SCD4X.h"
5555
#include "drivers/WipperSnapper_I2C_Driver_SEN5X.h"
56+
#include "drivers/WipperSnapper_I2C_Driver_SEN6X.h"
5657
#include "drivers/WipperSnapper_I2C_Driver_SGP30.h"
5758
#include "drivers/WipperSnapper_I2C_Driver_SGP40.h"
5859
#include "drivers/WipperSnapper_I2C_Driver_SHT3X.h"
@@ -164,6 +165,7 @@ class WipperSnapper_Component_I2C {
164165
WipperSnapper_I2C_Driver_VEML7700 *_veml7700 = nullptr;
165166
WipperSnapper_I2C_Driver_SCD4X *_scd40 = nullptr;
166167
WipperSnapper_I2C_Driver_SEN5X *_sen5x = nullptr;
168+
WipperSnapper_I2C_Driver_SEN6X *_sen6x = nullptr;
167169
WipperSnapper_I2C_Driver_SGP30 *_sgp30 = nullptr;
168170
WipperSnapper_I2C_Driver_SGP40 *_sgp40 = nullptr;
169171
WipperSnapper_I2C_Driver_PCT2075 *_pct2075 = nullptr;

Diff for: src/components/i2c/drivers/WipperSnapper_I2C_Driver_SEN5X.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
/*!
22
* @file WipperSnapper_I2C_Driver_SEN5X.h
33
*
4-
* Device driver for the SEN5X CO2, Temperature, and Humidity sensor.
5-
* TEMPORARY HACK
4+
* Device driver for the SEN5X air quality sensors.
65
*
76
* Adafruit invests time and resources providing this open source code,
87
* please support Adafruit and open-source hardware by purchasing
98
* products from Adafruit!
109
*
11-
* Copyright (c) Marni Brewster 2022 for Adafruit Industries.
10+
* Copyright (c) Tyeth Gundry 2022 for Adafruit Industries.
1211
*
1312
* MIT license, all text here must be included in any redistribution.
1413
*

0 commit comments

Comments
 (0)