Standby duration in milliseconds. Options:
1 ms = 00h,
62.5 ms = 01h,
125 ms = 02h,
250 ms = 03h,
500 ms = 04h,
1000 ms = 05h,
2000 ms = 06h,
4000 ms = 07h.
DEV@/bme280-device
To use the node in your project you should have the emiliosancheza/bme280-sensor library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.
C++ implementation
// Tell XOD where it could download the library:
#pragma XOD require "https://github.com/adafruit/Adafruit_Sensor"
#pragma XOD require "https://github.com/adafruit/Adafruit_BME280_Library"
//Include C++ libraries
{{#global}}
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
{{/global}}
// Reserve memory to store an instance of the Adafruit_BMP280 class,
// and create the instance later:
struct State {
uint8_t mem[sizeof(Adafruit_BME280)];
};
// Define our custom type as a pointer on the class instance.
using Type = Adafruit_BME280*;
{{ GENERATED_CODE }}
void evaluate(Context ctx) {
// It should be evaluated only once on the first (setup) transaction
if (!isSettingUp())
return;
auto state = getState(ctx);
// Create a new object in the memory area reserved previously.
Type bme = new (state->mem) Adafruit_BME280();
if (!bme->begin(0x76)) {
raiseError(ctx);
return;
}
uint8_t mode = getValue<input_MODE>(ctx);
uint8_t temp = getValue<input_OST>(ctx);
uint8_t pressure = getValue<input_OSP>(ctx);
uint8_t humidity = getValue<input_OSH>(ctx);
uint8_t filter = getValue<input_FILT>(ctx);
uint8_t standby = getValue<input_STDBY>(ctx);
bme -> setSampling(mode, temp, pressure, humidity, filter, standby);
emitValue<output_DEV>(ctx, bme);
}