GitHub linke here: https://github.com/CraigMarston/fancy_i2c-scanner
The idea from this project is because I have many cheap I2C devices bought from China via Fleabay or Aliexpress and they arrive with no documentation. To obtain their address I’d previously have to load up an Arduino board with the sniffer sketch, and obtain the address via the serial console on my laptop. This way I can just plug the device in to the reader to obtain its address!!
I2C scanner sketch with a TFT screen to build a standalone device
I2C scanner: Maybe elaborate, but I wanted to use an SPI screen to keep the I2C bus free! This size screen is around the same size as the tiny OLED screens anyhow.
I started off using an Arduino Nano clone, but I can’t be sure the cheap TFT screen is 5V tolerant — although it does have a 3.3V regulator on-board for its supply. I would have needed two 4-channel voltage shifters in this case, so just opted to use an ESP8266 device instead. An Arduino Nano Pro (3.3v) would be ideal for this.
The sketch is built from a basic I2C scanner and I’ve simply added the facility for the SPI screen.
The plan is to put this into a box so it becomes a tool that I can just grab.
Colour codes can be found here: https://github.com/esp8266/Basic/blob/master/libraries/Adafruit_ILI9341/Adafruit_ILI9341.h