How to use both 2 I2C interface on StickC-Plus2?
-
Env PlatformIO
platformio.ini:
... platform = espressif32 board = m5stick-c framework = arduino ... lib_deps = Wire m5stack/M5Unified m5stack/M5Unit-DDS
Question:
I connect 2 modules to StickC-Plus2, one on 'grove' port, the other on 'Ext.8-pin'. Is it correct to connect this way( or to say, is it possible to communicate with 2 modules through I2C separately through GPIO25-GPIO26 and GPIO32-GPIO33)? If this is correct, then how should I write the code?
Currently in my code, I defined the second 'TwoWire' object and initialized a module with it, but communication failed, while default 'TwoWire(0)' works well.
TwoWire I2C_DDS = TwoWire(1); ... I2C_DDS.begin(DDS_SDA, DDS_SCL); dds.begin(&I2C_DDS); ...
-
@俺がガンダムだ
Look at the definition of TwoWire, number should be fixed