0
votes

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?

1

1 Answers

1
votes

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