From da6827abb24aebf9a42dfb5255cf5449446ff75c Mon Sep 17 00:00:00 2001 From: brentru Date: Tue, 15 Aug 2023 14:12:35 -0400 Subject: [PATCH 1/2] add altitude --- Adafruit_Sensor.cpp | 3 +++ Adafruit_Sensor.h | 4 +++- README.md | 5 ++++- library.properties | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Adafruit_Sensor.cpp b/Adafruit_Sensor.cpp index 5107a93..b854a5a 100644 --- a/Adafruit_Sensor.cpp +++ b/Adafruit_Sensor.cpp @@ -100,6 +100,9 @@ void Adafruit_Sensor::printSensorDetails(void) { case SENSOR_TYPE_UNITLESS_PERCENT: Serial.print(F("Unitless Percent (%)")); break; + case SENSOR_TYPE_ALTITUDE: + Serial.print(F("Altitude (m)")); + break; } Serial.println(); diff --git a/Adafruit_Sensor.h b/Adafruit_Sensor.h index 1d854fd..cc2db03 100644 --- a/Adafruit_Sensor.h +++ b/Adafruit_Sensor.h @@ -79,7 +79,8 @@ typedef enum { SENSOR_TYPE_PM25_ENV = (27), SENSOR_TYPE_PM100_ENV = (28), SENSOR_TYPE_GAS_RESISTANCE = (29), - SENSOR_TYPE_UNITLESS_PERCENT = (30) + SENSOR_TYPE_UNITLESS_PERCENT = (30), + SENSOR_TYPE_ALTITUDE = (31) } sensors_type_t; /** struct sensors_vec_s is used to return a vector in a common format. */ @@ -171,6 +172,7 @@ typedef struct { the air (Ohms) */ float unitless_percent; /** maintainer=Adafruit sentence=Required for all Adafruit Unified Sensor based libraries. From 0f18c5c68b7d709bdc0482092896ca764d041969 Mon Sep 17 00:00:00 2001 From: brentru Date: Tue, 15 Aug 2023 14:24:51 -0400 Subject: [PATCH 2/2] clang! --- Adafruit_Sensor.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Adafruit_Sensor.h b/Adafruit_Sensor.h index cc2db03..8c6a07d 100644 --- a/Adafruit_Sensor.h +++ b/Adafruit_Sensor.h @@ -172,8 +172,9 @@ typedef struct { the air (Ohms) */ float unitless_percent; /**