You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-11Lines changed: 17 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,9 @@ typedef enum
85
85
SENSOR_TYPE_PM100_STD = (25),
86
86
SENSOR_TYPE_PM10_ENV = (26),
87
87
SENSOR_TYPE_PM25_ENV = (27),
88
-
SENSOR_TYPE_PM100_ENV = (28)
88
+
SENSOR_TYPE_PM100_ENV = (28),
89
+
SENSOR_TYPE_GAS_RESISTANCE = (29),
90
+
SENSOR_TYPE_UNITLESS_PERCENT = (30)
89
91
} sensors_type_t;
90
92
```
91
93
@@ -159,6 +161,8 @@ typedef struct
159
161
float pm10_env,
160
162
float pm25_env,
161
163
float pm100_env,
164
+
float gas_resistance,
165
+
float unitless_percent,
162
166
sensors_color_t color;
163
167
};
164
168
} sensors_event_t;
@@ -187,7 +191,7 @@ Calling this function will provide some basic information about the sensor (the
187
191
188
192
## Standardised SI values for `sensors_event_t`
189
193
190
-
A key part of the abstraction layer is the standardisation of values on SI units of a particular scale, which is accomplished via the data[4] union in sensors\_event\_t above. This 16 byte union includes fields for each main sensor type, and uses the following SI units and scales:
194
+
A key part of the abstraction layer is the standardization of values on SI units of a particular scale, which is accomplished via the data[4] union in sensors\_event\_t above. This 16 byte union includes fields for each main sensor type, and uses the following SI units and scales:
191
195
192
196
-**acceleration**: values are in **meter per second per second** (m/s^2)
193
197
-**magnetic**: values are in **micro-Tesla** (uT)
@@ -204,20 +208,22 @@ A key part of the abstraction layer is the standardisation of values on SI units
204
208
-**tvoc**: values are in **parts per billion** (ppb)
205
209
-**voc_index**: values are an **index** from 1-500 with 100 being normal
206
210
-**nox_index**: values are an **index** from 1-500 with 100 being normal
207
-
-**CO2**: values are in **parts per million*** (ppm)
208
-
-**eCO2**: values are in **parts per million*** (ppm)
209
-
-**pm10_std**: values are in **parts per million*** (ppm)
210
-
-**pm25_std**: values are in **parts per million*** (ppm)
211
-
-**pm100_std**: values are in **parts per million*** (ppm)
212
-
-**pm10_env**: values are in **parts per million*** (ppm)
213
-
-**pm25_env**: values are in **parts per million*** (ppm)
214
-
-**pm100_env**: values are in **parts per million*** (ppm)
211
+
-**CO2**: values are in **parts per million** (ppm)
212
+
-**eCO2**: values are in **parts per million** (ppm)
213
+
-**pm10_std**: values are in **parts per million** (ppm)
214
+
-**pm25_std**: values are in **parts per million** (ppm)
215
+
-**pm100_std**: values are in **parts per million** (ppm)
216
+
-**pm10_env**: values are in **parts per million** (ppm)
217
+
-**pm25_env**: values are in **parts per million** (ppm)
218
+
-**pm100_env**: values are in **parts per million** (ppm)
219
+
-**gas_resistance**: values are in **ohms**
220
+
-**unitless_percent**: values are in **%**
215
221
216
222
## The Unified Driver Abstraction Layer in Practice ##
217
223
218
224
Using the unified sensor abstraction layer is relatively easy once a compliant driver has been created.
219
225
220
-
Every compliant sensor can now be read using a single, well-known 'type' (sensors\_event\_t), and there is a standardised way of interrogating a sensor about its specific capabilities (via sensor\_t).
226
+
Every compliant sensor can now be read using a single, well-known 'type' (sensors\_event\_t), and there is a standardized way of interrogating a sensor about its specific capabilities (via sensor\_t).
221
227
222
228
An example of reading the [TSL2561](https://github.com/adafruit/Adafruit_TSL2561) light sensor can be seen below:
0 commit comments