Scan for addresses over an I2C connection using esp-hal and a esp32 development board (esp32c3 or esp32c6).
You can use this with a esp32c3 or esp32c6 board to scan for I2C devices through the esp-hal I2C abstraction and 2 GPIO ports (see src/bin/main.rs).
In order to run it is recommended that you use just run-<c3/c6>, since this selects both the right cargo featureset and also the right target (the two chips differ slightly on this.). Perhaps look in the justfile in project root.
Either use a standard package manager or do cargo install just.
All other rust toolchain things should automatically get installed once you run a just command.
When trying to use the ssd1309 display driver, I was not aware how to find the I2C address of the display.
It wrote this naïve scanner in order to find it, and it seems like it worked over both development boards when using just.
Pretty happy with how this is easily possible using the esp-hal family of libraries.