MatrixMiniR4 1.1.5
Matrix Mini R4 Arduino Library API Documentation
Loading...
Searching...
No Matches
GroveI2C_BME280 Class Reference

A class for interfacing with the BME280 sensor. More...

#include <MiniR4_GroveI2C_BME280.h>

Public Member Functions

bool begin (int i2c_addr=BME280_ADDRESS)
 Initializes the BME280 sensor.
 
float getTemperature (void)
 Reads the temperature from the BME280 sensor.
 
float getPressure (void)
 Reads the pressure from the BME280 sensor.
 
float getHumidity (void)
 Reads the humidity from the BME280 sensor.
 
float calcAltitude (float pressure)
 Calculates the altitude based on the pressure reading.
 

Public Attributes

uint8_t _ch =0
 
TwoWire * _pWire
 

Detailed Description

A class for interfacing with the BME280 sensor.

This class allows reading temperature, pressure, and humidity data from the BME280 sensor. It also provides functions to calculate altitude based on pressure readings.

Definition at line 68 of file MiniR4_GroveI2C_BME280.h.

Member Function Documentation

◆ begin()

bool GroveI2C_BME280::begin ( int i2c_addr = BME280_ADDRESS)

Initializes the BME280 sensor.

Parameters
i2c_addrThe I2C address of the BME280 sensor (default is BME280_ADDRESS).
Returns
true if initialization is successful, false otherwise.

Definition at line 16 of file MiniR4_GroveI2C_BME280.cpp.

◆ calcAltitude()

float GroveI2C_BME280::calcAltitude ( float pressure)

Calculates the altitude based on the pressure reading.

Parameters
pressureThe pressure in hPa.
Returns
The calculated altitude in meters.

Definition at line 153 of file MiniR4_GroveI2C_BME280.cpp.

◆ getHumidity()

float GroveI2C_BME280::getHumidity ( void )

Reads the humidity from the BME280 sensor.

Returns
The humidity as a percentage.

Definition at line 123 of file MiniR4_GroveI2C_BME280.cpp.

◆ getPressure()

float GroveI2C_BME280::getPressure ( void )

Reads the pressure from the BME280 sensor.

Returns
The pressure in hPa.

Definition at line 93 of file MiniR4_GroveI2C_BME280.cpp.

◆ getTemperature()

float GroveI2C_BME280::getTemperature ( void )

Reads the temperature from the BME280 sensor.

Returns
The temperature in degrees Celsius.

Definition at line 67 of file MiniR4_GroveI2C_BME280.cpp.

Member Data Documentation

◆ _ch

uint8_t GroveI2C_BME280::_ch =0

Definition at line 105 of file MiniR4_GroveI2C_BME280.h.

◆ _pWire

TwoWire* GroveI2C_BME280::_pWire

Definition at line 106 of file MiniR4_GroveI2C_BME280.h.


The documentation for this class was generated from the following files: