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

    Core2 v1.1 KmeterISO

    Units
    4
    5
    1.1k
    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.
    • B
      bignerd95
      last edited by

      I’m trying to test KmeterISO with core2 v1.1 and UIFlow 2.0

      I connected the KmeterISO to the red port, but if i try ti scan i2c addresses on port A (33, 32) it always shows zero addresses, so it fails to connect to address 0x66

      Any idea?

      Is KmeterISO compatible with Core2 v1.1?

      C 1 Reply Last reply Reply Quote 0
      • C
        czm88 @bignerd95
        last edited by

        @bignerd95 Did you ever get this working? I have the same problem, came here looking for help and found this post.

        teastainT 1 Reply Last reply Reply Quote 0
        • teastainT
          teastain @czm88
          last edited by

          @czm88 The Core 2 I2C pins are SDA 32, SCL 33.
          Perhaps this is the problem?

          Cheers, Terry!

          100% M5Stack addict with several drawers full of product!

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

            Hi guys

            KmeterISO unit is available in UIFlow2.1.2. Does it not work? (Note: I don't have that unit so I cannot test.)

            If you want to run an I2C scan (internal and on port A) check out my example in the UIFlow2 Project Zone: M5Core2_I2CScan_Intern_PortA_UIFlow2.1.2

            Thanks
            Felix

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

            1 Reply Last reply Reply Quote 0
            • C
              czm88
              last edited by czm88

              I just wanted to give an update in the event someone comes across the same issue in the future:

              I was able to get the KMeterISO to work with the Core.2 unit and using the Arduino IDE by doing the following:

              • I needed to download the M5Unit-KMeterISO library from GITHUB - https://github.com/m5stack/M5Unit-KMeterISO

              • I used the included "demo" example that was part of the library download but I had to make a few changes: I added a line "#include <M5Core2.h>" to the beginning. Added "M5.begin();" in void setup(), and finally changed the i2c pins from 21 & 22 to 32 & 33 in the kmeter.begin line - "while (!kmeter.begin(&Wire, KMETER_DEFAULT_ADDR, 32, 33, 100000L)) {"

              Here is the complete modified demo example code:

              #include "M5UnitKmeterISO.h"
              #include <M5Core2.h>
              #define INTERVAL_TIME 500
              
              M5UnitKmeterISO kmeter;
              uint8_t error_status = 0;
              long delay_time      = 0;
              
              long map(long x, long in_min, long in_max, long out_min, long out_max) {
                  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
              }
              
              void setup() {
                M5.begin();
                  Serial.begin(115200);
                  while (!kmeter.begin(&Wire, KMETER_DEFAULT_ADDR, 32, 33, 100000L)) {
                      Serial.println("Unit KmeterISO not found");
                  }
              
                  delay_time = millis() + INTERVAL_TIME;
              }
              
              void loop() {
                  if (millis() > delay_time) {
                      error_status = kmeter.getReadyStatus();
                      if (error_status == 0) {
                          Serial.printf("Celsius Temp: %.2fC\r\n",
                                        ((float)(kmeter.getCelsiusTempValue())) / 100);
                          Serial.printf("Fahrenheit Temp: %.2fF\r\n",
                                        ((float)(kmeter.getFahrenheitTempValue())) / 100);
                          Serial.printf(
                              "Chip Celsius Temp: %.2fC\r\n",
                              ((float)(kmeter.getInternalCelsiusTempValue())) / 100);
                          Serial.printf(
                              "Chip Fahrenheit Temp: %.2fF\r\n",
                              ((float)(kmeter.getInternalFahrenheitTempValue())) / 100);
                      } else {
                          Serial.printf("Error: %d", kmeter.getReadyStatus());
                      }
              
                      delay_time = millis() + INTERVAL_TIME;
                  }
              }
              
              1 Reply Last reply Reply Quote 0
              • First post
                Last post