#include <PubSubClient.h>
#include <ESP8266WiFi.h>
#include <Wire.h>
//#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
Adafruit_BME280 bme; // I2C
TwoWire Wire1 = TwoWire();
#define SSID "******"
#define PASS "******"
char MQTTServer[] = "192.168.0.200";
WiFiClient wifiClient;
PubSubClient client(wifiClient);
int wifi_status = WL_IDLE_STATUS;
unsigned long lastSend;
int value = 0;
void setup()
{
Serial.begin(9600);
InitWiFi();
client.setServer( MQTTServer, 1883 );
lastSend = 0;
Wire1.begin(D1,D2);
bool bme_status;
bme_status = bme.begin(0x76);
if (!bme_status) {
Serial.println("Could not find a valid BME280 sensor, check wiring!");
while (1);
}
delay(1000);
}
...
Thanks!