Domotique/WifiControlSensor/BME680.h

29 lines
743 B
C
Raw Permalink Normal View History

2020-02-27 00:07:30 +01:00
#pragma once
#ifdef CONFIG_ENABLE_BME680
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include "Adafruit_BME680.h"
#include "debug_sketch.h"
#define BME_SCK 13
#define BME_MISO 12
#define BME_MOSI 11
#define BME_CS 10
//Use Default i2c pin GPIO4(D2): SDA, GPIO5(D1):SCL
#define SEALEVELPRESSURE_HPA (1013.25)
#include <SFE_BMP180.h>
#include "debug_sketch.h"
int BME680GetMeasure(float &t, float &p, float &h, float &g, float &a);
int BME680Setup();
bool BME680IsConnected();
#else //CONFIG_ENABLE_BMP80
2020-02-28 17:16:39 +01:00
int BME680GetMeasure(float &, float &, float&, float &, float &){return -1;};
2020-02-27 00:07:30 +01:00
int BME680Setup(){SKETCH_DEBUG_PRINTLN("BME680 is disabled at build time"); return -1;};
bool BME680IsConnected(){return false;};
#endif