Core2 v1.1 KmeterISO
-
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?
-
@bignerd95 Did you ever get this working? I have the same problem, came here looking for help and found this post.
-
@czm88 The Core 2 I2C pins are SDA 32, SCL 33.
Perhaps this is the problem? -
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 -
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; } } -
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