[Info] I2C Scanner using ESP-IDF APIs
Posted: Thu Jan 26, 2017 1:25 am
While studying I2C, I wanted to see what it would take to create an equivalent of the "i2cdetect" tool found on Linux. This is a useful tool that pings each I2C address to see if anyone responds. Fortunately, this wasn't too difficult and I offer the following as an example:
https://github.com/nkolban/esp32-snippe ... cscanner.c
An illustrative output might be:
https://github.com/nkolban/esp32-snippe ... cscanner.c
An illustrative output might be:
Code: Select all
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --