0

I have multiple I2C devices on my bus and want to access (read or write) them one by one. What is the correct way?

  • open() -> set slave address -> write() -> close() -> open() -> set next slave address -> ...
  • open() -> set slave address -> write -> set next slave address -> write ...

Open and close the bus for each device or keep the bus open and only change the device address for each device?

Mat
208k41 gold badges407 silver badges423 bronze badges
asked May 24, 2013 at 9:00

1 Answer 1

1

I believe, there is no point in closing and re-opening the bus driver node for each access. Use the second strategy.

answered May 24, 2013 at 10:33
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.