Skip to content

Commit

Permalink
Merge pull request #176 from kike-canaries/av/i116_kelvin_support
Browse files Browse the repository at this point in the history
Av/i116 kelvin support
  • Loading branch information
hpsaturn authored Sep 21, 2023
2 parents 0fd31e7 + 264b40d commit cf73af0
Show file tree
Hide file tree
Showing 10 changed files with 539 additions and 224 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ DHT22 is supported but is not recommended. Please see the documentation.
- Unified calibration trigger for all CO2 sensors
- Unified CO2 Altitude compensation
- Unified temperature offset for CO2 and environment sensors
- Add support for Kelvin and Fahrenheit on environment and CO2 sensors
- Public access to main objects of each library (full methods access)
- Get unit symbol and name and each sub-sensor
- Get the main group type: NONE, PM, CO2 and ENV.
Expand Down Expand Up @@ -129,6 +130,7 @@ void setup() {
sensors.setSeaLevelPressure(1036.25); // [optional] Set sea level pressure in hpa
sensors.setDebugMode(false); // [optional] debug mode to get detailed msgs
sensors.detectI2COnly(true); // [optional] force to only i2c sensors
sensors.setTemperatureUnit(TEMPUNIT::KELVIN); // comment it for Celsius or set Fahrenheit
sensors.init(); // Auto detection to UART and i2c sensors

// Alternatives only for UART sensors (TX/RX):
Expand All @@ -143,8 +145,6 @@ void setup() {
// sensors.init(SENSORS::SAIRS8); // Force UART detection to SenseAirS8 CO2 sensor
// sensors.init(SENSORS::Auto,PMS_RX,PMS_TX); // Auto detection on custom RX,TX



// Also you can access to sub-library objects, and perform for example calls like next:

// sensors.sps30.sleep()
Expand Down
408 changes: 286 additions & 122 deletions doxygen.conf

Large diffs are not rendered by default.

36 changes: 25 additions & 11 deletions examples/advanced_multivariable/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,39 @@

[platformio]
src_dir = .
lib_dir = ../..
extra_configs = ../../unified-lib-deps.ini

[common_env_data]
[env]
framework = arduino
upload_speed = 1500000
monitor_speed = 115200
lib_deps =
hpsaturn/CanAirIO Air Quality Sensors Library
build_flags =
-D CORE_DEBUG_LEVEL=0
-D ARDUINO_ESP32_DEV=1
; -D DHT11_ENABLED=1 // Deprecated, please change this old sensor
; -D DHT_SENSOR_TYPE=2
; -D DHT_SENSOR_PIN=19
lib_deps = ${commonlibs.lib_deps}

[env:esp32dev]
[common]
framework = ${env.framework}
upload_speed = ${env.upload_speed}
monitor_speed = ${env.monitor_speed}
build_flags = ${env.build_flags}
lib_deps = ${env.lib_deps}

[env:esp32]
extends = common
platform = espressif32
board = esp32dev
framework = ${common_env_data.framework}
upload_speed = ${common_env_data.upload_speed}
monitor_speed = ${common_env_data.monitor_speed}
lib_deps = ${common_env_data.lib_deps}

[env:esp8266]
extends = common
platform = espressif8266
board = esp12e
framework = ${common_env_data.framework}
monitor_speed = ${common_env_data.monitor_speed}
lib_deps = ${common_env_data.lib_deps}

[env:atmelsam]
extends = common
platform = atmelsam
board = seeed_wio_terminal
3 changes: 2 additions & 1 deletion examples/advanced_multivariable/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ void setup() {
sensors.setSampleTime(10); // config sensors sample time interval
sensors.setOnDataCallBack(&onSensorDataOk); // all data read callback
sensors.setDebugMode(true); // [optional] debug mode
sensors.detectI2COnly(false); // disable force to only i2c sensors
sensors.detectI2COnly(true); // force to only i2c sensors
sensors.setTemperatureUnit(TEMPUNIT::KELVIN); // comment for Celsius or set Fahrenheit
sensors.init(); // Auto detection to UART and i2c sensors
delay(1000);
}
Expand Down
11 changes: 8 additions & 3 deletions examples/m5atom/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[platformio]
src_dir = .
lib_dir = ../..
extra_configs = ../../unified-lib-deps.ini

[env:esp32dev]
platform = espressif32
board = esp32dev
Expand All @@ -18,6 +23,6 @@ build_flags =
-D CORE_DEBUG_LEVEL=0
-D M5ATOM
lib_deps =
fastled/FastLED@^3.5.0
m5stack/M5Atom@^0.0.7
hpsaturn/CanAirIO Air Quality Sensors Library @ ^0.5.5
fastled/FastLED@^3.5.0
m5stack/M5Atom@^0.0.7
${commonlibs.lib_deps}
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CanAirIO Air Quality Sensors Library",
"version": "0.7.0",
"version": "0.7.1",
"homepage":"https://canair.io",
"keywords":
[
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=CanAirIO Air Quality Sensors Library
version=0.7.0
version=0.7.1
author=@hpsaturn, CanAirIO project <[email protected]>
maintainer=Antonio Vanegas <[email protected]>
url=https://github.com/kike-canaries/canairio_sensorlib
Expand Down
Loading

0 comments on commit cf73af0

Please sign in to comment.