🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    ATOM Lite and ENV.II

    Atom
    3
    4
    6.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      regres
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        Hi @regres

        the Groove connector on M5Atom Lite uses GPIO26 and GPIO32 as SDA and SDL. Try this:

          M5.begin(true, false, true);
          Wire.begin(26, 32);
        

        Note: second parameter to M5.begin() set to false to disable default I2C initialisation (which uses different GPIOs). Then initialise I2C with desired GPIOs.

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        R 1 Reply Last reply Reply Quote 1
        • R
          regres @felmue
          last edited by

          Hi @felmue

          Thank you for the advice, the Wire.begin(26, 32) is what I was missing.
          I tired M5.begin(true, false, true) before but, by itself, it didn't make any difference.

          Looks like explicitly specifying I2C pins is the way to go.

          Again, thank you
          regres

          1 Reply Last reply Reply Quote 0
          • G
            gavin67890
            last edited by

            I have tried using code above and similar from M5Stack repo. I changed the pin assignments to 19 and 22, which works fine on an alt. setup with Atom Lite, Env I hat, and Atom Mate.

            Using the setup below:
            Atom Matrix
            Env II hat
            Atom Mate

            I get this error and continuous reset loop.

            [ 913][W][Wire.cpp:301] begin(): Bus already started in Master Mode.
            Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.

            If I pull out the hat, I get a warning via the code that it is disconnected. I know the origin of this post was from long ago, but I can't think what could be causing it. Is there any difference between Env II unit and Env II hat? Any other thoughts welcome.

            Atom LITE | Atom Matrix | StickC | CORE2 | Paper | ...

            1 Reply Last reply Reply Quote 0
            • First post
              Last post