diff --git a/examples/Arduino_Nano_example.cpp b/examples/Arduino_Nano_example.cpp new file mode 100644 index 0000000..0c376a1 --- /dev/null +++ b/examples/Arduino_Nano_example.cpp @@ -0,0 +1,31 @@ +#include +#include + +BME::Bosch_BME280 bme{-1, -1, 0x77, 249.67F, true}; + +void setup() { + Serial.begin(115200); + while (!Serial) { + yield(); + } + + // init Bosch BME 280 Sensor + if (bme.begin() != 0) { + Serial.println("\n\t>>> ERROR: Init of Bosch BME280 Sensor failed! <<<"); + } +} + +void loop() { + static unsigned long tic {millis()}; + unsigned long ms = millis(); + if (ms - tic >= 2000) { + tic = ms; + bme.measure(); + Serial.print("\n\tTemperature:\t"); + Serial.println(bme.getTemperature()); + Serial.print("\tHumidity:\t"); + Serial.println(bme.getHumidity()); + Serial.print("\tPressure at NN:\t"); + Serial.println(bme.getSealevelForAltitude()); + } +} \ No newline at end of file diff --git a/library.json b/library.json index 822741b..e2960b9 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Bosch_BME280_Arduino", - "version": "0.0.3", + "version": "0.0.4", "description": "Arduino Wrapper Class for use of BME280 Sensor based on the original Bosch Sensortec Driver", "keywords": ["temperature", "humidity", "pressure", "bme280", "Bosch", "Sensortec"], "authors":