42. I2C Scanner

Design an I2C address scanner using an Arduino Uno to identify slave devices connected to the I2C bus. The program scans the bus, detects active slave addresses, and prints the detected addresses (in hexadecimal format) along with the total number of devices on the Serial Monitor.

 

Sample Example

Expected output when two I2C slave devices are connected,

 

Submit Your Solution