M5Atom I2c
-
Hi all,
i'm playing with the mpu6886, with the Arduino lib i can read it.
how can i use the "grove" connector (g26,g32) with a i2c device at the same time?thx Michael
-
ok...i find out that i have to use SoftwareI2c and the i2c device must have pullup resistors:
#include "SoftwareI2C.h"
SoftwareI2C softwarei2c;
void setup() {
Serial.begin(115200);
softwarei2c.begin(26, 32); // sda, scl
Serial.println("begin to scan...");
}void loop() {
for (unsigned char i = 1; i <= 127; i++) {
if (softwarei2c.beginTransmission(i)) {
Serial.print("0x");
Serial.println(i, HEX);while (1); } softwarei2c.endTransmission(); } Serial.println("find nothing"); while (1);}
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