tnks for answering !!
but:
#include <Wire.h>
#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 < 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 < 16)
Serial.print("0");
Serial.print(address, HEX);
Serial.println(" !");
nDevices++;
}
else if (error == 4)
{
Serial.print("Unknow error at address 0x");
if (address < 16)
Serial.print("0");
Serial.println(address, HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
}
and the output:
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 -> Preferences.