How can use the option I2C pins

Issue #346 resolved
Sean shao created an issue

Hello,Some esp32 or pico boards have 2 group i2c pins. There’s fixed i2c pins in VM. Is there easy way to use another’s?

Thanks

Comments (7)

  1. John Maloney repo owner

    At the moment there is no way to change the I2C pins in MicroBlocks.

    Although some boards do have several possible I2C pins groups, they usually only offer I2C on a few specific pin pairs. That would make a pin-switching feature tricky to use except by advanced users.

    A bigger issue is portability. MicroBlocks projects can run on many different boards. If it had a command to set specific I2C pins then projects that used that command would be less portable; they could run only on one type of board.

    Could you say more about your specific situation? Which board are you using and why do you want to use different I2C pins?

  2. Sean shao reporter

    I was using the m5stickC plus when I encountered the problem, the sensor can be linked to the head pin port, but also to the tail grove interface.
    GPIO 0/26 pins in the header for I2C 
    GPIO 32/33 pin in the tail grove port for I2C

  3. John Maloney repo owner

    Thanks for sharing that info. I understand why you'd like a way to use the secondary I2C port on the ESP32.

    Unfortunately, MicroBlocks no longer supports the M5StickC or M5StickC Plus. Could you use a different M5 product to control your Rover such as:

    Basic Core (expensive, but has nice display)

    Atom Lite (low cost but no built-in battery)

    Both of those products make the I2C pins available to MicroBlocks, although you'd need a Grove adaptor cable. Another option would be to use a Raspberry Pi Pico W board such as:

    Cyton Maker Pi Pico

    On the Pico and Pico W, MicroBlocks uses pins 4 and 5 for I2C (see special pins) and that board has a Grove connector for those pins.

    Good luck with your project!

  4. Sean shao reporter

    Thanks for your advice. I have solved the problem by using DuPont cable to adapt the grove interface.

  5. Log in to comment