eil/i2cdev
uploaded 2 months ago

ESP-IDF I2C master thread-safe utilities

readme of i2c_scanner example

# I2C bus scanner ## What it does This example scans the i2c bus in a loop and prints out a table with the addresses of the found i2c devices. ## Wiring Connect `SCL` and `SDA` pins to the following pins with appropriate pull-up resistors. | Name | Description | Defaults | |------|-------------|----------| | `CONFIG_EXAMPLE_I2C_MASTER_SCL` | GPIO number for `SCL` | "5" for `esp8266`, "6" for `esp32c3`, "19" for `esp32`, `esp32s2`, and `esp32s3` | | `CONFIG_EXAMPLE_I2C_MASTER_SDA` | GPIO number for `SDA` | "4" for `esp8266`, "5" for `esp32c3`, "18" for `esp32`, `esp32s2`, and `esp32s3` | ## Example output Three devices found on a bus: 0x38, 0x60 and 0x77 ``` 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- 38 -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- 77 ```

Supports all targets

Maintainer

  • Ruslan V. Uss <unclerus@gmail.com>

License: MIT

To add this component to your project, run:

idf.py add-dependency "eil/i2cdev^1.5.1"

or download archive

Dependencies

  • eil/esp_idf_lib_helpers >=1.2.1
  • ESP-IDF >=4.3
  • Examples:

    i2c_scanner

    more details

    Stats

    • Downloaded in total
      Downloaded in total 36 times
    • Downloaded this version
      This version: 36 times

    Badge

    eil/i2cdev version: 1.5.1 |