• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Reuse I2C or SPI pins

Q&A Forum › Category: ESP32 › Reuse I2C or SPI pins
0 Vote Up Vote Down
SALAH ALHADDABI asked 4 years ago

Dear,

I would like to know how I reuse my I2C or SPI pins on the ESP32 board with another component if an existing component is already using one of them?

Question Tags: ESP32 LORA NRF24
2 Answers
0 Vote Up Vote Down
SALAH ALHADDABI answered 4 years ago

I think the most important question here is how do I use the I2C pins or the SPI pins if already equiped by other components??

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi.

You can set more than one I2C bus with the ESP32 by using the Wire library. See this discussion where they explain how to use two I2C bus simultaneously: https://github.com/espressif/arduino-esp32/issues/977

You can also set more than one SPI connection. For example, if you’re using several sensors that work via SPI, normally you can define the SPI pins when instantiating the library. So, you just need to pass wherever SPI pins you choose to the initialization.

With the ESP32 almost any pin can be set as SPI or I2C.

I hope this helps.

Let me know if you need further help.

Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] SMART HOME with RPi, ESP32, and ESP8266 (version 1.2) March 8, 2023
  • [eBook Updated] ESP32-CAM Projects (version 1.3) January 7, 2023

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2023 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.