From a902f89d35c4e56b253c3a1599f9504c2c43a749 Mon Sep 17 00:00:00 2001 From: brentru Date: Fri, 3 Mar 2023 11:18:00 -0500 Subject: [PATCH] addresses https://github.com/adafruit/Adafruit_Sensor/issues/47 --- Adafruit_Sensor.cpp | 3 +++ Adafruit_Sensor.h | 7 +++++-- README.md | 21 ++++++++++++--------- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Adafruit_Sensor.cpp b/Adafruit_Sensor.cpp index 94aa0b5..626077c 100644 --- a/Adafruit_Sensor.cpp +++ b/Adafruit_Sensor.cpp @@ -94,6 +94,9 @@ void Adafruit_Sensor::printSensorDetails(void) { case SENSOR_TYPE_PM100_ENV: Serial.print(F("Environmental Particulate Matter 100 (ppm)")); break; + case SENSOR_TYPE_GAS_RESISTANCE: + Serial.print(F("Gas Resistance (ohms)")); + break; } Serial.println(); diff --git a/Adafruit_Sensor.h b/Adafruit_Sensor.h index 8cb6c97..7e3de3e 100644 --- a/Adafruit_Sensor.h +++ b/Adafruit_Sensor.h @@ -77,7 +77,8 @@ typedef enum { SENSOR_TYPE_PM100_STD = (25), SENSOR_TYPE_PM10_ENV = (26), SENSOR_TYPE_PM25_ENV = (27), - SENSOR_TYPE_PM100_ENV = (28) + SENSOR_TYPE_PM100_ENV = (28), + SENSOR_TYPE_GAS_RESISTANCE = (29), } sensors_type_t; /** struct sensors_vec_s is used to return a vector in a common format. */ @@ -163,8 +164,10 @@ typedef struct { million (ppm) */ float pm25_env; /**< Environmental Particulate Matter 2.5 in parts per million (ppm) */ - float pm100_env; /**< EnvironmentalParticulate Matter 100 in parts per + float pm100_env; /**< Environmental Particulate Matter 100 in parts per million (ppm) */ + float gas_resistance; /**< Proportional to the amount of VOC particles in + the air (Ohms) */ sensors_color_t color; /**< color in RGB component values */ }; ///< Union for the wide ranges of data we can carry } sensors_event_t; diff --git a/README.md b/README.md index 16574fd..d552752 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,8 @@ typedef enum SENSOR_TYPE_PM100_STD = (25), SENSOR_TYPE_PM10_ENV = (26), SENSOR_TYPE_PM25_ENV = (27), - SENSOR_TYPE_PM100_ENV = (28) + SENSOR_TYPE_PM100_ENV = (28), + SENSOR_TYPE_GAS_RESISTANCE = (29) } sensors_type_t; ``` @@ -159,6 +160,7 @@ typedef struct float pm10_env, float pm25_env, float pm100_env, + float gas_resistance, sensors_color_t color; }; } sensors_event_t; @@ -204,14 +206,15 @@ A key part of the abstraction layer is the standardisation of values on SI units - **tvoc**: values are in **parts per billion** (ppb) - **voc_index**: values are an **index** from 1-500 with 100 being normal - **nox_index**: values are an **index** from 1-500 with 100 being normal -- **CO2**: values are in **parts per million*** (ppm) -- **eCO2**: values are in **parts per million*** (ppm) -- **pm10_std**: values are in **parts per million*** (ppm) -- **pm25_std**: values are in **parts per million*** (ppm) -- **pm100_std**: values are in **parts per million*** (ppm) -- **pm10_env**: values are in **parts per million*** (ppm) -- **pm25_env**: values are in **parts per million*** (ppm) -- **pm100_env**: values are in **parts per million*** (ppm) +- **CO2**: values are in **parts per million** (ppm) +- **eCO2**: values are in **parts per million** (ppm) +- **pm10_std**: values are in **parts per million** (ppm) +- **pm25_std**: values are in **parts per million** (ppm) +- **pm100_std**: values are in **parts per million** (ppm) +- **pm10_env**: values are in **parts per million** (ppm) +- **pm25_env**: values are in **parts per million** (ppm) +- **pm100_env**: values are in **parts per million** (ppm) +- **gas_resistance**: values are in **ohms** ## The Unified Driver Abstraction Layer in Practice ##