Sony's Developer World forum

    • Home
    • Forum guidelines

    Upcoming maintenance 

     

    Dear Customers and Partners.

    This website will be undergoing scheduled maintenance on June 14, 2023. Please be aware there may be disruption to the developer portal website and associated services during the scheduled maintenance period.

    This upgrade is essential to ensure the continued performance, reliability, and security of Developer World.

    We apologize for any inconvenience.

     

     

    Simple I2C example

    Spresense
    2
    2
    1482
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    This topic has been deleted. Only users with topic management privileges can see it.
    • Y
      yokonav last edited by yokonav

      I would like Spresense (I2C Master) to communicate with an Arduino Uno ( (I2C Slave) over I2C pins (specifically I2C0_SCL/I2C0_SDA). I am using nuttx on the Spresense. The closest example I could find is hostif but it assumes two Spresense boards. I would like to see a minimal example to send a text command to Arduino Uno over I2C.

      PS: I have tried the Arduino I2C Master/Slave example on both of the boards and it works as expected so I believe there should be something similar in nuttx Spresense SDK.

      Thanks,
      Naveen

      K 1 Reply Last reply Reply Quote
      • K
        KamilTomaszewski DeveloperWorld @yokonav last edited by

        Hi @yokonav,

        Here you can find how to send and receive data as I2C master: https://github.com/sonydevworld/spresense/blob/master/examples/hostif/host_i2c_main.c

        Alternatively, you can see the Wire library implementation in the Spresense Arduino because it also uses the NuttX: https://github.com/sonydevworld/spresense-arduino-compatible/blob/master/Arduino15/packages/SPRESENSE/hardware/spresense/1.0.0/libraries/Wire/Wire.cpp

        Best Regards,
        Kamil Tomaszewski

        1 Reply Last reply Reply Quote
        • First post
          Last post
        Developer World
        Copyright © 2021 Sony Group Corporation. All rights reserved.
        • Contact us
        • Legal