You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
634 B

7 years ago
#ifndef _BME280_H
#define _BME280_H
#include <Arduino.h>
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
static constexpr uint8_t BME_SCK = 5; // SCL/SCK
static constexpr int BME_MISO = 19; //SDO
static constexpr int BME_MOSI = 27; //SDA/SDI
static constexpr int BME_CS = 23; // CS
#define SEALEVELPRESSURE_HPA (1013.25)
class BME280 {
public:
BME280();
bool begin(void);
void printValues(void);
float readTemperature(void);
float readPressure(void);
float readHumidity(void);
private:
Adafruit_BME280 *bme;
bool status;
};
#endif /* _BME280_H */