File tree Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,9 @@ void Adafruit_Sensor::printSensorDetails(void) {
100100 case SENSOR_TYPE_UNITLESS_PERCENT:
101101 Serial.print (F (" Unitless Percent (%)" ));
102102 break ;
103+ case SENSOR_TYPE_ALTITUDE:
104+ Serial.print (F (" Altitude (m)" ));
105+ break ;
103106 }
104107
105108 Serial.println ();
Original file line number Diff line number Diff line change @@ -79,7 +79,8 @@ typedef enum {
7979 SENSOR_TYPE_PM25_ENV = (27 ),
8080 SENSOR_TYPE_PM100_ENV = (28 ),
8181 SENSOR_TYPE_GAS_RESISTANCE = (29 ),
82- SENSOR_TYPE_UNITLESS_PERCENT = (30 )
82+ SENSOR_TYPE_UNITLESS_PERCENT = (30 ),
83+ SENSOR_TYPE_ALTITUDE = (31 )
8384} sensors_type_t ;
8485
8586/* * struct sensors_vec_s is used to return a vector in a common format. */
@@ -171,7 +172,9 @@ typedef struct {
171172 the air (Ohms) */
172173 float unitless_percent; /* *<Percentage, unit-less (%) */
173174 sensors_color_t color; /* *< color in RGB component values */
174- }; // /< Union for the wide ranges of data we can carry
175+ float altitude; /* *< Distance between a reference datum and a point or
176+ object, in meters. */
177+ }; // /< Union for the wide ranges of data we can carry
175178} sensors_event_t ;
176179
177180/* Sensor details (40 bytes) */
Original file line number Diff line number Diff line change @@ -87,7 +87,8 @@ typedef enum
8787 SENSOR_TYPE_PM25_ENV = (27),
8888 SENSOR_TYPE_PM100_ENV = (28),
8989 SENSOR_TYPE_GAS_RESISTANCE = (29),
90- SENSOR_TYPE_UNITLESS_PERCENT = (30)
90+ SENSOR_TYPE_UNITLESS_PERCENT = (30),
91+ SENSOR_TYPE_ALTITUDE = (31),
9192} sensors_type_t ;
9293```
9394
@@ -163,6 +164,7 @@ typedef struct
163164 float pm100_env,
164165 float gas_resistance,
165166 float unitless_percent,
167+ float altitude,
166168 sensors_color_t color;
167169 };
168170} sensors_event_t ;
@@ -218,6 +220,7 @@ A key part of the abstraction layer is the standardization of values on SI units
218220- ** pm100_env** : values are in ** parts per million** (ppm)
219221- ** gas_resistance** : values are in ** ohms**
220222- ** unitless_percent** : values are in ** %**
223+ - ** altitude** : values are in ** meters** (m)
221224
222225## The Unified Driver Abstraction Layer in Practice ##
223226
Original file line number Diff line number Diff line change 11name =Adafruit Unified Sensor
2- version =1.1.11
2+ version =1.1.12
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