NAME Device::Chip::BME280 - chip driver for BME280 SYNOPSIS use Device::Chip::BME280; use Future::AsyncAwait; my $chip = Device::Chip::BME280->new; await $chip->mount( Device::Chip::Adapter::...->new ); await $chip->change_config( OSRS_H => 4, OSRS_P => 4, OSRS_T => 4, MODE => "NORMAL", ); my ( $pressure, $temperature, $humidity ) = await $chip->read_sensor; printf "Temperature=%.2fC ", $temperature; printf "Pressure=%dPa ", $pressure; printf "Humidity=%.2f%%\n", $humidity; DESCRIPTION This Device::Chip subclass provides specific communication to a Bosch BME280 attached to a computer via an I²C adapter. As this chip is a variation of the BMP280 which adds a humidity sensor, this module is a subclass of Device::Chip::BMP280. See that module for documentation on overall configuration, and access to the temperature and pressure sensors common to both chips. The reader is presumed to be familiar with the general operation of this chip; the documentation here will not attempt to explain or define chip-specific concepts or features, only the use of this module to access them. METHODS The following methods documented in an await expression return Future instances. In addition this module inherits all the methods provided by Device::Chip::BMP280. read_config $config = await $chip->read_config; Returns a HASH reference containing the chip config, which includes all the registers provided by Device::Chip::BMP280, and additionally: OSRS_H => SKIP | 1 | 2 | 4 | 8 | 16 change_config await $chip->change_config( %changes ); Writes updates to the configuration registers. Accepts OSRS_H as defined above. read_raw ( $adc_P, $adc_T, $adc_H ) = await $chip->read_raw; Returns three integers containing the raw ADC reading values from the sensor. This method is mostly for testing or internal purposes only. For converted sensor readings in real-world units you want to use "read_sensor". read_sensor ( $pressure, $temperature, $humidity ) = await $chip->read_sensor; Returns the sensor readings appropriately converted into units of Pascals for pressure, degrees Celcius for temperature, and percentage relative for humidity. AUTHOR Paul Evans