Classes

  Name
class BME

Source code

/******************************************************************************
NW_BME280.h — NW_BME280
Northern Widget interface for the Bosch BME280 temperature, humidity,
and pressure sensor.

Bobby Schulz @ Northern Widget LLC

Wraps the Adafruit BME280 library to provide the Northern Widget sensor
API: begin(), getHeader(), getString(), and the raw readings interface.
Returns atmospheric pressure in mBar, relative humidity in %, and
temperature in °C.

Distributed as-is; no warranty is given.
******************************************************************************/

#ifndef NW_BME280_h
#define NW_BME280_h

#include "Arduino.h"
#include <Adafruit_BME280.h>

class BME
{
    public:
        BME();

        bool begin(uint8_t ADR_ = 0x77);

        float getPressure();

        float getHumidity();

        float getTemperature();

        String getHeader();

        String getString();

        void beginRawReadings();

        uint16_t takeRawReading(char* buf, uint16_t offset);

        void endRawReadings();

        // PascalCase aliases — deprecated, use camelCase versions above
        [[deprecated("Use getPressure()")]]    float GetPressure();
        [[deprecated("Use getHumidity()")]]    float GetHumidity();
        [[deprecated("Use getTemperature()")]] float GetTemperature();
        [[deprecated("Use getHeader()")]]      String GetHeader();
        [[deprecated("Use getString()")]]      String GetString();

    private:
        Adafruit_BME280 Sensor;
        uint8_t ADR = 0x77;
};

#endif

Updated on 2026-05-15 at 05:04:17 +0000