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-DDSQuestion:
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
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