Skip to content

Commit

Permalink
Updating docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Glenn committed Nov 22, 2017
1 parent 64774ce commit 794daa6
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 35 deletions.
70 changes: 39 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -177,41 +178,47 @@ 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.

#### 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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -280,7 +287,7 @@ or
* Metric: bool, default = true
values: true = return degrees Celsius, false = return degrees Fahrenheit

```


## Contributing
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ pres KEYWORD2
hum KEYWORD2
read KEYWORD2
Altitude KEYWORD2
SealevelAlitude KEYWORD2
EquivalentSeaLevelPressure KEYWORD2
DewPoint KEYWORD2
6 changes: 3 additions & 3 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name=BME280
version=2.2.1
author=Tyler Glenn <protglenn@gmail.com>
maintainer=Tyler Glenn <protglenn@gmail.com>
version=2.3.0
author=Tyler Glenn <[email protected].com>
maintainer=Tyler Glenn <[email protected].com>
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
Expand Down
1 change: 1 addition & 0 deletions src/EnvironmentCalculations.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 794daa6

Please sign in to comment.