The I2C Command Line Interface (CLI) project is designed to facilitate direct interaction with I2C devices without the need for writing code. It serves as a convenient tool for testing and exploring I2C devices, enabling users to quickly check register values, test write capabilities, and understand device behaviors. This project is particularly useful for developers and electronics enthusiasts looking to experiment with or debug I2C devices, offering a straightforward way to send commands and receive responses through a simple serial connection.
You only need to
- Flash the MCU
- Connect the I2C device
- Connect to the MCU via the serial terminal
Here's an example session showing how you can communicate with an I2C device:
Compiled binary files can be downloaded from the Releases section. These files can be flashed to the ESP8266 using this online flashing tool.
After flashing, you can interact with the device using the serial terminal.
Special thanks to @SpacehuhnTech for providing the flashing and terminal utilities.
addr [i2c_address]: Get or set the I2C address.reg [register_address]: Get or set the register address.bit [position] [value]: Get or set the bit at the specified position.byte [value]: Get or set the byte at the current register address.bits [start pos] [end pos] [val]: Get or set multiple bits from start to end positions.map [start] [end]: Show a map of registers from start to end.scan: Scan the I2C bus for devices.hex: Set the output format to HEX.bin: Set the output format to BIN.help: Show the list of available commands.
Since Wi-Fi or other special ESP8266 peripherals are not used here, this code can be used on other microcontrollers supported by ArduinoIDE
