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

    ENV III M5StickC-Plus SHT3X issues

    Scheduled Pinned Locked Moved Units
    4 Posts 3 Posters 5.4k Views
    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 Offline
      risingmoon
      last edited by

      I bought both the M5StickC Plus and ENV III Hat from digikey, but I have not been able to get temperature from SHT3X in Arduino IDE. I keep getting Wire.endTransmission() return value of for NACK. How do I fix/debug this or is this HAT broken?

      #include <M5Unified.h>
      #include <Wire.h>
      
      void setup() {
        M5.begin();
        Serial.begin(115200);
        Wire.begin();
        
      }
      
      void loop() {
        // Start I2C Transmission
        Wire.beginTransmission(0x44);
        
        // Send measurement command
        Wire.write(0x2C);
        Wire.write(0x06);
        
        // Stop I2C transmission
        int result = Wire.endTransmission();
        if (result != 0) {
          Serial.println("Failed");
          Serial.println(result);
        }
        delay(5000);
      }
      
      1 Reply Last reply Reply Quote 0
      • felmueF Offline
        felmue
        last edited by

        Hello @risingmoon

        try Wire.begin(0,26);. (Note: Information taken from this example).

        If that doesn't help maybe try with UIFlow to figure out whether there is a hardware issue.

        Thanks
        Felix

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

        R 1 Reply Last reply Reply Quote 0
        • robskiR Offline
          robski
          last edited by

          @risingmoon have a look here
          https://github.com/m5stack/UNIT_ENV/blob/master/examples/UNIT_ENV_III/UNIT_ENV_III.ino

          M5StickC, M5StickCPlus, M5StickCplus2,M5GO, M5Core, M5Tough, M5Core2, M5 Demo Board, M5Dial, M5Paper, M5Atom, M5Cardputer, M5StampS3, CoreMP135, StamPLC, AirQ, M5Tab, M5CardputerAdv, M5StackChan

          1 Reply Last reply Reply Quote 0
          • R Offline
            risingmoon @felmue
            last edited by

            @felmue This fixed the issue! Thanks. I found that this was the issue. It was using Wire.begin() instead of Wire.begin(0,26)

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post