I am trying to understand how to use i2C without any success.
Using any of the examples available, including in libraries, etc. I always have an exception:
Indeed I have not yet the i2C hardware connected to the bus.
I am on the process of migrating some stuff from netMF and I am sure that the addr is fine as it was working without issues.
As the slave is on an removable board, could you please suggest any way to avoid the exception in the case where it is not present?
Thank you.
As Mike said, handle the exception or find a way to not talk on the i2c bus. Might be worth it to do both, since that way you will always be able to report the error back (“Hello user, looks like sensor X has gone bad or is not connected”) as well as not bothering to initialise it when you know it isn’t connected