🤖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

    Units
    3
    4
    4.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
      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
        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
          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

          1 Reply Last reply Reply Quote 0
          • R
            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
            • First post
              Last post