Hello,
I'm trying to get the working with ENV.II unit using modified sample code from https://github.com/m5stack/M5-ProductExampleCodes/blob/master/Unit/ENVII/Arduino/ENVII/ENVII.ino but I keep getting the "Could not find a valid BMP280 sensor, check wiring!" error.
I've got the ENV.II working with M5Stack Core, but can't figure out the ATOM Lite.
The code is as follows:
#include "M5Atom.h"
#include <Wire.h>
#include "Adafruit_Sensor.h"
#include <Adafruit_BMP280.h>
#include "SHT3X.h"
SHT3X sht30;
Adafruit_BMP280 bme;
float tmp = 0.0;
float hum = 0.0;
float pressure = 0.0;
void setup()
{
M5.begin(true, true, true);
Wire.begin();
Serial.println(F("ENV Unit(SHT30 and BMP280) test..."));
while (!bme.begin(0x76))
{
Serial.println("Could not find a valid BMP280 sensor, check wiring!");
}
}
void loop() {
pressure = bme.readPressure();
if(sht30.get()==0){
tmp = sht30.cTemp;
hum = sht30.humidity;
}
Serial.printf("Temperature: %2.2f*C Humidity: %0.2f%% Pressure: %0.2fPa\r\n", tmp, hum, pressure);
delay(100);
}
Any suggestions would be appreciated,
Thank you