Skip to content

Commit

Permalink
rework to be ready for Arduino Library registriy
Browse files Browse the repository at this point in the history
  • Loading branch information
hasenradball committed Oct 27, 2023
1 parent ee38416 commit 0ad0062
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 11 deletions.
44 changes: 35 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
# Bosch BME280 Arduino
based on Bosch BME280_driver v3.5.1

List of content<br>
* [About](#about)<br>
* [Functionality](#functionality)<br>
* [Namespace](#namespace)<br>
* [Methods](#methods)<br>
* [Example](#example)<br>
* [Compatibility](#compatibility)
* [Copyright](#copyright)


## About
The Bosch BME280 is an environmental sensor which is able to measure temperature, humidity and air pressure.

This library is based on the Bosch Sensortec BME280 driver API v3.5.1, and is intented to measure the these environmental signals via I²C connection on an Arduino based or ESP based microcontroller.
This library is based on the Bosch Sensortec BME280 driver API v3.5.1, and is intented to measure these environmental signals via I²C connection on an Arduino based or ESP based microcontroller.

The github repository of Bosch Sensortec is: https://github.com/BoschSensortec/BME280_driver
The github repository of Bosch Sensortec is: [Github BOSCH Sensor Driver](https://github.com/BoschSensortec/BME280_driver)

The website of the BME280 on Bosch Sensortec is: https://www.bosch-sensortec.com/products/environmental-sensors/humidity-sensors-bme280/
The website of the BME280 on Bosch Sensortec is: [Bosch Sensortec BME280](https://www.bosch-sensortec.com/products/environmental-sensors/humidity-sensors-bme280/)

## Functionality
The original Bosch driver is included in this package and it has not been modified in any way.
The Bosch BME280 sensor do have 3 operation modes.
1. Sleep mode - the sensor is in sleep mode after power on reset. No measurements are performed and power consumtion is on minimum.
2. Forced mode - one single measurement is performed and returns then to sleep mode. The measurements can be obtained from the data registers.
3. Normal mode - cyclic measurements are performed. The measurements can be obtained fron the data registers.
1. **Sleep mode** - the sensor is in sleep mode after power on reset. No measurements are performed and power consumtion is on minimum.
2. **Forced mode** - one single measurement is performed and returns then to sleep mode. The measurements can be obtained from the data registers.
3. **Normal mode** - cyclic measurements are performed. The measurements can be obtained fron the data registers.

## Namespace
This Bosch BME280 Wraper uses a namespace as `BME` so if you construct the object you have to call:
Expand Down Expand Up @@ -52,7 +62,17 @@ getHumidity()
getPressure()
getSealevelForAltitude()
```
### Short Example
#### Sensor Status
Also it is possible to get and set the sensor status.
```
int8_t status = getSensorStatus();
setSensorStatus(status);
```

### Example
See also in:
[Arduino_Nano_example.ino](https://github.com/hasenradball/Bosch_BME280_Arduino/blob/master/examples/Arduino_Nano_example.ino)

```
#include <Arduino.h>
#include <Bosch_BME280_Arduino.h>
Expand Down Expand Up @@ -89,12 +109,18 @@ void loop() {


## Compatibility
* Tested with Arduino Nano, ESP8266 and ESP32
Tested with:
* Arduino Nano
* ESP8266
* ESP32
* Arduino Nano 33 IOT

## Copyright
The Files:
The Files of the original Bosch BME280 driver API:
* bme280.c
* bme280.h
* bme280_defs.h

are Copyright (c) 2013 - 2017 by Bosch Sensortec GmbH

[back to top](#bosch-bme280-arduino)
File renamed without changes.
20 changes: 20 additions & 0 deletions keyword.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Syntax Coloring Map For Bosch_BME280_Arduino Library

# Datatypes (KEYWORD1)
BME KEYWORD1
Bosch_BME280 KEYWORD1

# Methods and Functions (KEYWORD2)
begin KEYWORD2
measure KEYWORD2
getTemperature KEYWORD2
getHumidity KEYWORD2
getPressure KEYWORD2
getSealevelForAltitude KEYWORD2
getSensorStatus KEYWORD2
setSensorStatus KEYWORD2


# Constants (LITERAL1)
BME280_I2C_ADDR_PRIM LITERAL1
BME280_I2C_ADDR_SEC LITERAL1
4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Bosch_BME280_Arduino",
"version": "1.0.1",
"version": "1.0.2",
"repository":
{
"type": "git",
Expand All @@ -16,5 +16,5 @@
"maintainer": true
},
"frameworks": ["Arduino"],
"platforms": ["atmelavr", "espressif8266", "espressif32"]
"platforms": ["atmelavr", "espressif8266", "espressif32", "atmelsam"]
}
10 changes: 10 additions & 0 deletions library.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name=Bosch_BME280_Arduino
version=1.0.2
author=Frank Häfele <[email protected]>
maintainer=Frank Häfele <[email protected]>
sentence=C++ Library for the Bosch BME280 Sensor based on the original Bosch Sensor API v3.5.1
paragraph=Provides a Namespace, setter and getter functions to get access to read temperature, humidity amd pressure signals.
category=Sensors
url=https://github.com/hasenradball/Bosch_BME280_Arduino
architectures=*
includes=Bosch_BME280_Arduino.h
File renamed without changes.
File renamed without changes.

0 comments on commit 0ad0062

Please sign in to comment.