<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[I2C sensor to grove port on M5Stick GRAY (NOT C)]]></title><description><![CDATA[<p dir="auto">Hi, is it possible to connect an I2C sensor (VL53L1X) on the grove port of the stick (GRAY) and at the same time use the internal MPU9250(0x68) and IP5306(0x75)?<br />
I'm trying with TwoWire and the I2c scanner..</p>
<pre><code>#include &lt;Wire.h&gt;
#define SDA2 25
#define SCL2 13
TwoWire Wire1 = TwoWire(1);

void setup()
{
  Serial.println("M5 I2C Tester");
  Wire.begin();
  Wire1.begin(SDA2, SCL2, 400000); 
  Serial.begin(115200);

  delay(3000);
}

void loop()
{
  // scan for i2c devices
  byte error, address;
  int nDevices;

  Serial.println("Scanning...");

  nDevices = 0;
  for (address = 1; address &lt; 127; address++ )
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address &lt; 16)
        Serial.print("0");
      Serial.print(address, HEX);
      Serial.println("  !");

      nDevices++;
    }
    else if (error == 4)
    {
      Serial.print("Unknow error at address 0x");
      if (address &lt; 16)
        Serial.print("0");
      Serial.println(address, HEX);
    }
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");
}
</code></pre>
<p dir="auto">but Arduino IDE doesn't compile with this output:</p>
<pre><code>libraries/Wire/Wire.cpp.o:(.bss.Wire1+0x0): multiple definition of `Wire1'
sketch/I2C_Serial_Tester2.ino.cpp.o:(.bss.Wire1+0x0): first defined here
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board M5Stack-Core-ESP32.
</code></pre>
<p dir="auto">ideas?</p>
<p dir="auto">tnks a lot..</p>
]]></description><link>https://community.m5stack.com/topic/1260/i2c-sensor-to-grove-port-on-m5stick-gray-not-c</link><generator>RSS for Node</generator><lastBuildDate>Wed, 17 Jun 2026 04:25:43 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/1260.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 27 Aug 2019 20:36:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to I2C sensor to grove port on M5Stick GRAY (NOT C) on Thu, 29 Aug 2019 12:21:28 GMT]]></title><description><![CDATA[<p dir="auto">tnks for answering !!<br />
but:</p>
<pre><code>#include &lt;Wire.h&gt;
#define SDA2 25
#define SCL2 13
TwoWire Wire1 = TwoWire(1);

void setup()
{
  Serial.println("M5 I2C Tester");
  //Wire.begin();
  Wire1.begin(SDA2, SCL2, 400000); 
  Serial.begin(115200);

  delay(3000);
}

void loop()
{
  // scan for i2c devices
  byte error, address;
  int nDevices;

  Serial.println("Scanning...");

  nDevices = 0;
  for (address = 1; address &lt; 127; address++ )
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address &lt; 16)
        Serial.print("0");
      Serial.print(address, HEX);
      Serial.println("  !");

      nDevices++;
    }
    else if (error == 4)
    {
      Serial.print("Unknow error at address 0x");
      if (address &lt; 16)
        Serial.print("0");
      Serial.println(address, HEX);
    }
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");
}
</code></pre>
<p dir="auto">and the output:</p>
<pre><code>Arduino: 1.8.9 (Mac OS X), Board: "M5Stack-Core-ESP32, QIO, 80MHz, Default, 921600, None"

libraries/Wire/Wire.cpp.o:(.bss.Wire1+0x0): multiple definition of `Wire1'
sketch/sketch_aug29a.ino.cpp.o:(.bss.Wire1+0x0): first defined here
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board M5Stack-Core-ESP32.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -&gt; Preferences.

</code></pre>
]]></description><link>https://community.m5stack.com/post/5367</link><guid isPermaLink="true">https://community.m5stack.com/post/5367</guid><dc:creator><![CDATA[cepics]]></dc:creator><pubDate>Thu, 29 Aug 2019 12:21:28 GMT</pubDate></item><item><title><![CDATA[Reply to I2C sensor to grove port on M5Stick GRAY (NOT C) on Wed, 28 Aug 2019 05:00:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cepics" aria-label="Profile: cepics">@<bdi>cepics</bdi></a> said in <a href="/post/5327">I2C sensor to grove port on M5Stick GRAY (NOT C)</a>:</p>
<blockquote>
<p dir="auto">Wire.begin();<br />
Wire1.begin(SDA2, SCL2, 400000);</p>
</blockquote>
<pre><code>Wire.begin();
  Wire1.begin(SDA2, SCL2, 400000);
</code></pre>
<p dir="auto">Try deleting Wire.begin();</p>
]]></description><link>https://community.m5stack.com/post/5332</link><guid isPermaLink="true">https://community.m5stack.com/post/5332</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Wed, 28 Aug 2019 05:00:00 GMT</pubDate></item></channel></rss>