B4R Question Using rWire at the same time as I2C libraries

Discussion in 'B4R Questions' started by Chris Tyrie, May 7, 2019.

  1. Chris Tyrie

    Chris Tyrie Member Licensed User

    I have a magnetometer I talk to with rWire code I wrote. I'm also using a SSD1306 display for the results.
    This seems to cause a clash and the nano just keeps rebooting. I'm guessing because they are both masters of the I2C bus at the same time.
    Is there some way to get the SSD1306 library's I2C master object or release the rWire master...
    Basically, how can I have a rWire master at the same time as an I2C library object?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Have you tried to connect the SSD1306 with the SPI interface?
     
  3. Chris Tyrie

    Chris Tyrie Member Licensed User

    I could simply use a serial LCD. However, since b4r lacks library wrappers for most sensors, I will have to interface directly with many sensors I will use, and thus, this problem will be repetitively encountered if I wish to use any I2C based libraries in conjunction with rWire based code.

    I hoping not to have to directly interface with modules for which there are already libraries, nor write my own libraries in C if I can avoid it.

    Is there any way to make a rwire master play nicely with an I2C library's master, or am I simply doomed?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You can see rWire code. It is quite simple, especially the code of WireMaster. I don't see any native API that can help here.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice