diff --git a/README.md b/README.md index 86cae0c..265ade7 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,11 @@ Provides an Arduino library for reading and interpreting Bosch BME280 data over - [float pres(PresUnit unit)](#methods) - [float hum()](#methods) - [void read(float& pressure, float& temp, float& humidity, TempUnit tempUnit, PresUnit presUnit)](#methods) - - [uint8_t chipID()](#methods) + - [ChipModel chipModel()](#methods) 9. [Environment Calculations](#environment-calculations) - - [float Alitude(float pressure, bool metric = true, float seaLevelPressure = 101325)](#environment-calculations) - - [float SealevelAlitude(float alitude, float temp, float pres)](#environment-calculations) + - [float Altitude(float pressure, bool metric = true, float seaLevelPressure = 101325)](#environment-calculations) + - [float EquivalentSeaLevelPressure(float altitude, float temp, float pres)](#environment-calculations) - [float DewPoint(float temp, float hum, bool metric = true)](#environment-calculations) 10. [Contributing](#contributing) 11. [History](#history) @@ -113,6 +113,7 @@ or ## Settings #### BME280::Settings Struct +``` * Temperature Oversampling Rate (tempOSR): OSR Enum, default = OSR_X1 * Humidity Oversampling Rate (humOSR): OSR Enum, default = OSR_X1 @@ -127,14 +128,14 @@ or * SPI Enable: SpiEnable Enum, default = false values: true = enable, false = disable - +``` #### BME280I2C::Settings Struct * Includes all fields in BME280 settings. ``` * BME 280 Address (bme280Addr): uint8_t, default = 0x76 -```` +``` #### BME280Spi::Settings Struct * Includes all fields in BME280 settings. @@ -177,14 +178,14 @@ or Method used at start up to initialize the class. Starts the I2C or SPI interface. Can be called again to re-initialize the mode settings. ``` - * return: bool, true = success, false = failure (no device found) + * return: bool, true = success, false = failure (no device found) ``` #### void setSettings(const Settings& settings) Method to set the sensor settings. - - + + #### const Settings& getSettings() const Method to get the sensor settings. @@ -192,26 +193,32 @@ or #### float temp(TempUnit unit) Read the temperature from the BME280 and return a float. - Return: float = temperature +``` + return: float = temperature * unit: tempUnit, default = TempUnit_Celsius +``` #### float pres(PresUnit unit) Read the pressure from the BME280 and return a float with the specified unit. - Return: float = pressure +``` + return: float = pressure * unit: uint8_t, default = PresUnit_Pa +``` #### float hum() Read the humidity from the BME280 and return a percentage as a float. +``` * return: float = percent relative humidity - +``` #### void read(float& pressure, float& temp, float& humidity, TempUnit tempUnit, PresUnit presUnit) Read the data from the BME280 with the specified units. - Return: None, however, pressure, temp and humidity are changed. +``` + return: None, however, pressure, temp and humidity are changed. * Pressure: float, reference values: reference to storage float for pressure @@ -225,24 +232,20 @@ or * tempUnit: tempUnit, default = TempUnit_Celsius * presUnit: uint8_t, default = PresUnit_Pa - -#### uint8_t chipID() - Returns the chip identification number. - ``` - * return: uint8_t 0x60 = BME ID, 0x58 = BMP ID - ``` +``` #### ChipModel chipModel() - Return: [ChipModel](#chipmodel-enum) enum - +``` + * return: [ChipModel](#chipmodel-enum) enum +``` ## Environment Calculations -#### float Alitude(float pressure, bool metric = true, float seaLevelPressure = 101325) +#### float Altitude(float pressure, bool metric = true, float seaLevelPressure = 101325) Calculate the altitude based on the pressure with the specified units. Return: float = altitude - +``` * Pressure: float, unit = Pa values: any float @@ -251,26 +254,30 @@ or * Sea Level Pressure: float, unit = Pa, default = 101325 values: any float +``` -#### float SealevelAlitude(float alitude, float temp, float pres) +#### float EquivalentSeaLevelPressure(float altitude, float temp, float pres) - Convert current pressure to sea-level pressure, returns - Altitude (in meters), temperature in Celsius + Convert current pressure to equivalent sea-level pressure. - Return: The equivalent pressure at sea level. +``` + return: The equivalent pressure at sea level. - * alitude: float + * altitude: float values: meters * temp: float values: celsius - * hum: float + * pres: float + values: unit independent +``` #### float DewPoint(float temp, float hum, bool metric = true) Calculate the dew point based on the temperature and humidity with the specified units. - Return: float = dew point +``` + return: float = dew point * Temperature: float, unit = Celsius if metric is true, Fahrenheit if metric is false values: any float @@ -280,7 +287,7 @@ or * Metric: bool, default = true values: true = return degrees Celsius, false = return degrees Fahrenheit - +``` ## Contributing @@ -297,12 +304,13 @@ or - Sep 19, 2016 - Version 2.0.0 released (Restructure for I2C and SPI) - Nov 21, 2016 - Version 2.0.1 released (Set mode support) - Dec 19, 2016 - Version 2.1.0 released (Support for SPI) -- Dec 21, 2016 - Version 2.1.1 released (Fixing compilation errors) +- Dec 21, 2016 - Version 2.1.1 released (Bugs) - Feb 17, 2017 - Version 2.1.2 released (Docs) - Sept 9, 2017 - Version 2.1.3 released (Formatting, reorg) - Sept 13, 2017 - Version 2.1.4 released (Examples update, bug fixes) - Oct 7, 2017 - Version 2.2.0 released (Enums, begin restructure) - Oct 10, 2017 - Version 2.2.1 released (Bug fixes) +- Nov 21, 2017 - Version 2.3.0 released (Examples updates, env calc fixes, bugs) ## Credits diff --git a/keywords.txt b/keywords.txt index 000bd35..16a0c02 100644 --- a/keywords.txt +++ b/keywords.txt @@ -6,5 +6,5 @@ pres KEYWORD2 hum KEYWORD2 read KEYWORD2 Altitude KEYWORD2 -SealevelAlitude KEYWORD2 +EquivalentSeaLevelPressure KEYWORD2 DewPoint KEYWORD2 diff --git a/library.properties b/library.properties index 882a83b..a2e09fd 100644 --- a/library.properties +++ b/library.properties @@ -1,7 +1,7 @@ name=BME280 -version=2.2.1 -author=Tyler Glenn -maintainer=Tyler Glenn +version=2.3.0 +author=Tyler Glenn +maintainer=Tyler Glenn sentence=Provides a library for reading and interpreting Bosch BME280 environmental sensor data over I2C, SPI or Sw SPI. paragraph=Reads temperature, humidity, and pressure. Includes environment calculations. Provides functions for english and metric. Also reads pressure in Pa, hPa, inHg, atm, bar, torr, N/m^2 and psi. ESP and BRZO I2C support. category=Sensors diff --git a/src/EnvironmentCalculations.h b/src/EnvironmentCalculations.h index 3598fb8..a182da6 100644 --- a/src/EnvironmentCalculations.h +++ b/src/EnvironmentCalculations.h @@ -56,6 +56,7 @@ namespace EnvironmentCalculations /// Convert current pressure to sea-level pressure, returns /// Altitude (in meters), temperature in Celsius /// return the equivalent pressure at sea level. + /// @deprecated float SealevelAlitude( float alitude, float temp,