Modifying

This commit is contained in:
fatimaxsen 2025-05-04 09:49:20 +03:00
parent da59ffb827
commit 3eef8c019d

View File

@ -1,18 +1,50 @@
# I2C Communication Library # I2C Communication Library
This library provides functionalities for I2C communication, specifically designed for controlling devices that support the I2C protocol. It includes utilities for scanning I2C buses, changing slave addresses, and handling commands. **I2CRelay** is an 8-relay module built around the ESP32-C3 Super Mini, featuring an I2C interface that allows it to be controlled by another MCU, enabling easy integration into complex control systems. Additionally, when paired with an ESP32-C3-based controller, it can leverage Wi-Fi and Bluetooth LE connectivity, expanding control options beyond wired I2C communication for wireless operation and enhanced flexibility in IoT and robotics applications. This combination of compact size, low power consumption, and versatile communication protocols makes the module indispensable for remote and automated control of multiple devices, offering scalable and reliable switching solutions for smart homes, industrial automation, and advanced robotics.
## Table of Contents ## Table of Contents
1. [Overview](#overview) 1. [Technical Drawings](#technical_drawings)
2. [Files](#files) 2. [Features](#Features)
3. [Class: I2CMasterUtils](#class-i2cmastertools) 3. [Hardware Components Used](#hardware_components_used)
4. [Class: I2CRelay](#class-i2crelay) 4. [Installation](#installation)
5. [Usage Example](#usage-example) 5. [Versatility](#versatility)
6. [Usage](#usage)
7. [API Overview](#api-overview)
8. [Example Serial Commands](#example-serial-commands)
9. [Notes](#notes)
10. [Credits](#credits)
11. [License](#license)
12. [Project Image](#project-image)
---
### Technical Drawings
---
### Features
.....
---
### Hardware Components Used
- 8 Relay Module.
- Esp32C3 Super Mini.
- Flywheel.
---
### Installation
## Overview
The library provides functionalities for I2C communication, specifically designed for controlling devices that support the I2C protocol. It includes utilities for scanning I2C buses, changing slave addresses, and handling commands.
## Files ## Files
@ -30,9 +62,15 @@ The library is composed of several files, each with a specific role:
4. **I2CRelay.cpp** [4] 4. **I2CRelay.cpp** [4]
- Contains the implementation of methods for the `I2CRelay` class. - Contains the implementation of methods for the `I2CRelay` class.
## Class: I2CMasterUtils ---
### Static Methods ### Versatility
The I2CMotor offers exceptional versatility, as it can function as a standalone device and can be adapted to be USB-controlled instead of relying solely on I2C communication. This flexibility allows users to easily integrate the motor into a wide range of projects and control environments. Furthermore, the motors firmware can be reprogrammed to support Wi-Fi and Bluetooth connectivity, enabling wireless control and making it ideal for modern applications in robotics, automation, and IoT. This adaptability ensures that the I2CMotor can meet diverse requirements and evolve with your projects needs.
---
### API Overview
- **scanI2C(Stream &output = Serial)** - **scanI2C(Stream &output = Serial)**
- Scans the I2C bus for connected devices and prints their addresses. - Scans the I2C bus for connected devices and prints their addresses.
@ -43,9 +81,7 @@ The library is composed of several files, each with a specific role:
- **parseChangeAddressCommand(const String &input, uint8_t &oldAddr, uint8_t &newAddr)** - **parseChangeAddressCommand(const String &input, uint8_t &oldAddr, uint8_t &newAddr)**
- Parses an input string to extract the old and new slave addresses from a "ch" command. - Parses an input string to extract the old and new slave addresses from a "ch" command.
## Class: I2CRelay #### Methods
### Methods
- **I2CRelay(uint8_t slaveAddress)** - **I2CRelay(uint8_t slaveAddress)**
- Constructor that initializes the `I2CRelay` object with the given slave address. - Constructor that initializes the `I2CRelay` object with the given slave address.