Ardunino: a class to check I2C bus
I transformed the classic function to check the status of the I2C bus into a class. This way when I turn on a hardware I can make sure that the peripherals are connected
- I2CTest i2cTest; Create an instance of the class
- i2cTest.begin(Wire); inject your Wire object, so you pilot the bus from main class
- int* addresses = i2cTest.scan(count); execute the scan. 'count' indicates how many devices were found, while 'addresses' is the array of devices addresses
The main.cpp contain a full example