Mita

The following code will read the temperature, pressure and humidity of the environmental sensor and print the values to the console every 1 second.

every 1 second {
    var humi = environment.humidity.read();
    var pres = environment.pressure.read();
    var temp = environment.temperature.read();
    println(`Humidity: ${humi}   Pressure: ${pres}   Temperature: ${temp}`);
}

Configurations

Power Mode

The BME280 offers two operation modes, called Power Modes:

  • Normal Power Mode, will be in a state of perpetual cycling between measurement periods and inactive periods

  • Force Power Mode, perform one measurement, store the results and the return to sleep mode.

Standby Time

Determine the duration of the inactive periods in Normal Power Mode

Oversampling

Oversampling can be used to reduce noise in the resulting sensor value. Please note that a higher oversampling means that measurement time and power consumption increase.

The configuration-items temperature_oversampling, pressure_oversampling, humidity_oversampling

Last updated

Was this helpful?