File tree Expand file tree Collapse file tree 4 files changed +27
-5
lines changed Expand file tree Collapse file tree 4 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,12 @@ void Adafruit_Sensor::printSensorDetails(void) {
6464 case SENSOR_TYPE_TVOC:
6565 Serial.print (F (" Total Volatile Organic Compounds (ppb)" ));
6666 break ;
67+ case SENSOR_TYPE_VOC_INDEX:
68+ Serial.print (F (" Volatile Organic Compounds (Index)" ));
69+ break ;
70+ case SENSOR_TYPE_NOX_INDEX:
71+ Serial.print (F (" Nitrogen Oxides (Index)" ));
72+ break ;
6773 }
6874
6975 Serial.println ();
Original file line number Diff line number Diff line change @@ -67,7 +67,9 @@ typedef enum {
6767 SENSOR_TYPE_VOLTAGE = (15 ),
6868 SENSOR_TYPE_CURRENT = (16 ),
6969 SENSOR_TYPE_COLOR = (17 ),
70- SENSOR_TYPE_TVOC = (18 )
70+ SENSOR_TYPE_TVOC = (18 ),
71+ SENSOR_TYPE_VOC_INDEX = (19 ),
72+ SENSOR_TYPE_NOX_INDEX = (20 )
7173} sensors_type_t ;
7274
7375/* * struct sensors_vec_s is used to return a vector in a common format. */
@@ -136,8 +138,12 @@ typedef struct {
136138 float current; /* *< current in milliamps (mA) */
137139 float voltage; /* *< voltage in volts (V) */
138140 float tvoc; /* *< Total Volatile Organic Compounds, in ppb */
139- sensors_color_t color; /* *< color in RGB component values */
140- }; // /< Union for the wide ranges of data we can carry
141+ float voc_index; /* *< VOC (Volatile Organic Compound) index where 100 is
142+ normal (unitless) */
143+ float nox_index; /* *< NOx (Nitrogen Oxides) index where 100 is normal
144+ (unitless) */
145+ sensors_color_t color; /* *< color in RGB component values */
146+ }; // /< Union for the wide ranges of data we can carry
141147} sensors_event_t ;
142148
143149/* Sensor details (40 bytes) */
Original file line number Diff line number Diff line change @@ -74,7 +74,10 @@ typedef enum
7474 SENSOR_TYPE_AMBIENT_TEMPERATURE = (13),
7575 SENSOR_TYPE_VOLTAGE = (15),
7676 SENSOR_TYPE_CURRENT = (16),
77- SENSOR_TYPE_COLOR = (17)
77+ SENSOR_TYPE_COLOR = (17),
78+ SENSOR_TYPE_TVOC = (18),
79+ SENSOR_TYPE_VOC_INDEX = (19),
80+ SENSOR_TYPE_NOX_INDEX = (20)
7881} sensors_type_t ;
7982```
8083
@@ -137,6 +140,9 @@ typedef struct
137140 float relative_humidity;
138141 float current;
139142 float voltage;
143+ float tvoc;
144+ float voc_index;
145+ float nox_index;
140146 sensors_color_t color;
141147 };
142148} sensors_event_t ;
@@ -179,6 +185,10 @@ A key part of the abstraction layer is the standardisation of values on SI units
179185- ** current** : values are in ** milliamps** (mA)
180186- ** voltage** : values are in ** volts** (V)
181187- ** color** : values are in 0..1.0 RGB channel luminosity and 32-bit RGBA format
188+ - ** tvoc** : values are in ** parts per billion** (ppb)
189+ - ** voc_index** : values are an ** index** from 1-500 with 100 being normal
190+ - ** nox_index** : values are an ** index** from 1-500 with 100 being normal
191+
182192
183193## The Unified Driver Abstraction Layer in Practice ##
184194
Original file line number Diff line number Diff line change 11name =Adafruit Unified Sensor
2- version =1.1.6
2+ version =1.1.7
33author =Adafruit <info@adafruit.com>
44maintainer =Adafruit <info@adafruit.com>
55sentence =Required for all Adafruit Unified Sensor based libraries.
You can’t perform that action at this time.
0 commit comments