pub enum Mode {
Standby,
Pressure,
Temperature,
ContinuousPressure,
ContinuousTemperature,
ContinuousPressureTemperature,
}Expand description
Use Barometer::set_mode to set the mode.
In continuous mode, the sensor will take measurements at the rate set by Barometer::set_pressure_config and Barometer::set_temperature_config. Note that pressure readings are dependent on temperature readings, so it is not recommended to use continuous mode for pressure readings because they will be calculated using out-of-date temperature readings.
Temperature and Pressure modes are intended to be used when the sensor is in standby mode. They will take a new temperature or pressure reading, and then set the sensor to standby mode. Setting the mode to one of these modes is equivalent to calling Barometer::request_temperature_reading or Barometer::request_pressure_reading.
Variants§
Standby
The default mode. The sensor will not take any measurements. It is still possible to read the temperature and pressure, but the values will not be updated.
Pressure
Take a single temperature reading and then return to standby mode.
Temperature
Take a single pressure reading and then return to standby mode.
ContinuousPressure
Take continuous pressure readings at the configured sample rate. Note that this mode is not recommended because pressure readings are dependent on temperature readings, so they will be calculated using out-of-date temperature readings.
ContinuousTemperature
Take continuous temperature readings at the configured sample rate.
ContinuousPressureTemperature
Take continuous pressure and temperature readings at the configured sample rate.