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) {
64
64
case SENSOR_TYPE_TVOC:
65
65
Serial.print (F (" Total Volatile Organic Compounds (ppb)" ));
66
66
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 ;
67
73
}
68
74
69
75
Serial.println ();
Original file line number Diff line number Diff line change @@ -67,7 +67,9 @@ typedef enum {
67
67
SENSOR_TYPE_VOLTAGE = (15 ),
68
68
SENSOR_TYPE_CURRENT = (16 ),
69
69
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 )
71
73
} sensors_type_t ;
72
74
73
75
/* * struct sensors_vec_s is used to return a vector in a common format. */
@@ -136,8 +138,12 @@ typedef struct {
136
138
float current; /* *< current in milliamps (mA) */
137
139
float voltage; /* *< voltage in volts (V) */
138
140
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
141
147
} sensors_event_t ;
142
148
143
149
/* Sensor details (40 bytes) */
Original file line number Diff line number Diff line change @@ -74,7 +74,10 @@ typedef enum
74
74
SENSOR_TYPE_AMBIENT_TEMPERATURE = (13),
75
75
SENSOR_TYPE_VOLTAGE = (15),
76
76
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)
78
81
} sensors_type_t ;
79
82
```
80
83
@@ -137,6 +140,9 @@ typedef struct
137
140
float relative_humidity;
138
141
float current;
139
142
float voltage;
143
+ float tvoc;
144
+ float voc_index;
145
+ float nox_index;
140
146
sensors_color_t color;
141
147
};
142
148
} sensors_event_t ;
@@ -179,6 +185,10 @@ A key part of the abstraction layer is the standardisation of values on SI units
179
185
- ** current** : values are in ** milliamps** (mA)
180
186
- ** voltage** : values are in ** volts** (V)
181
187
- ** 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
+
182
192
183
193
## The Unified Driver Abstraction Layer in Practice ##
184
194
Original file line number Diff line number Diff line change 1
1
name =Adafruit Unified Sensor
2
- version =1.1.6
2
+ version =1.1.7
3
3
author =Adafruit <
[email protected] >
4
4
maintainer =Adafruit <
[email protected] >
5
5
sentence =Required for all Adafruit Unified Sensor based libraries.
You can’t perform that action at this time.
0 commit comments