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
1 Answer 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
Alexander Amelkin
8081 gold badge10 silver badges18 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
default