klips/esp/cpp/06_i2c-scanner
..
2025-02-09 11:59:38 -05:00
2025-02-09 11:59:38 -05:00
2025-02-09 11:59:38 -05:00
2025-02-09 11:59:38 -05:00
2025-02-09 11:59:38 -05:00
2025-02-09 11:59:38 -05:00

06_i2c-scanner

schematic

Simple I2C device scanner.

For this example I used this SSD1306 OLED display.

To build the example run the following commands.

source ~/path/to/esp-idf/export.sh

mkdir build
cd build
cmake ..
make -j $(nproc)

# Flash to ESP32
make flash

# Open Serial Monitor, press CTRL+] to exit.
make monitor

Expected output in serial monitor at 115200 baud

Scanning I2C devices...
[0x3c]: Device found with clock rate 100000 and timeout 50
Done.