You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ESP32_IO_Expander is a library designed for driving [IO expander chips](#supported-drivers) using ESP32 SoCs.
9
+
## Overview
10
+
11
+
`ESP32_IO_Expander` is a library designed for driving [IO expander chips](#supported-drivers) using ESP SoCs. It encapsulates various components from the [Espressif Components Registry](https://components.espressif.com/) and includes the following features:
12
+
13
+
* Supports various IO expander chips, such as TCA95xx, HT8574, and CH422G.
14
+
* Supports controlling individual IO pin with functions like `pinMode()`, `digitalWrite()`, and `digitalRead()`.
15
+
* Supports controlling multiple IO pins simultaneously with functions like `multiPinMode()`, `multiDigitalWrite()`, and `multiDigitalRead()`.
16
+
* Compatible with the `Arduino`, `ESP-IDF` and `MicroPython` for compilation.
17
+
18
+
## Table of Contents
19
+
20
+
-[ESP32\_IO\_Expander](#esp32_io_expander)
21
+
-[Overview](#overview)
22
+
-[Table of Contents](#table-of-contents)
23
+
-[Supported Drivers](#supported-drivers)
24
+
-[How to Use](#how-to-use)
25
+
-[ESP-IDF Framework](#esp-idf-framework)
26
+
-[Dependencies and Versions](#dependencies-and-versions)
-[Where is the directory for Arduino libraries?](#where-is-the-directory-for-arduino-libraries)
37
+
-[How to Install ESP32\_IO\_Expander in Arduino IDE?](#how-to-install-esp32_io_expander-in-arduino-ide)
10
38
11
-
ESP32_IO_Expander encapsulates various components from the [Espressif Components Registry](https://components.espressif.com/). It is developed based on [arduino-esp32](https://github.com/espressif/arduino-esp32) or [esp-idf](https://github.com/espressif/esp-idf), and can be easily downloaded and integrated into the Arduino IDE.
`ESP32_IO_Expander` has been uploaded to the [Espressif Component Registry](https://components.espressif.com/), and users can add it to their project using the `idf.py add-dependency` command, for example:
Alternatively, users can create or modify the *idf_component.yml* file in the project directory. For more details, please refer to the [Espressif Documentation - IDF Component Manager](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-component-manager.html).
43
69
44
-
## How to Use
70
+
#### Configuration Instructions
71
+
72
+
Since `ESP32_IO_Expander` depends on the `esp-lib-utils` library which implements the `logging`, `checking`, and `memory` functions, to configure it when using ESP-IDF, please refer to the [instructions](https://github.com/esp-arduino-libs/esp-lib-utils#configuration-instructions).
For information on how to use the library in the Arduino IDE, please refer to the documentation for [Arduino IDE v1.x.x](https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries) or [Arduino IDE v2.x.x](https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-installing-a-library).
83
+
#### Installing the Library
84
+
85
+
For installation of the `ESP32_IO_Expander` library, refer to [How to Install ESP32_IO_Expander in Arduino IDE](#how-to-install-ESP32_IO_Expander-in-arduino-ide).
86
+
87
+
#### Configuration Instructions
88
+
89
+
Since `ESP32_IO_Expander` depends on the `esp-lib-utils` library which implements the `logging`, `checking`, and `memory` functions, to configure it when using Arduino, please refer to the [instructions](https://github.com/esp-arduino-libs/esp-lib-utils#configuration-instructions-1).
47
90
48
91
### Examples
49
92
50
-
*[Test Functions](examples/TestFunctions): Demonstrates how to use ESP32_IO_Expander and test all functions.
51
-
*[Test CH422G](examples/TestCH422G): Demonstrates how to use ESP32_IO_Expander with the CH422G chip.
93
+
*[General](examples/general): Demonstrates how to use `ESP32_IO_Expander` and test general functions.
94
+
*[CH422G](examples/ch422g): Demonstrates how to use `ESP32_IO_Expander` specifically with the CH422G chip.
52
95
53
96
### Detailed Usage
54
97
55
98
```cpp
56
-
#include<ESP_IOExpander_Library.h>
99
+
#include<esp_io_expander.hpp>
57
100
58
-
// Create and initialize an ESP_IOExpander object according to the chip type
59
-
ESP_IOExpander *expander = new ESP_IOExpander_TCA95xx_8bit(EXAMPLE_I2C_NUM_0, ESP_IO_EXPANDER_I2C_TCA9554_ADDRESS_000,
60
-
EXAMPLE_I2C_SCL_PIN, EXAMPLE_I2C_SDA_PIN);
101
+
// Create and initialize the IO expander chip, such as TCA95XX_8BIT
102
+
esp_expander::Base *expander = new esp_expander::TCA95XX_8BIT(
Users can find and modify the directory path for Arduino libraries by selecting `File` > `Preferences` > `Settings` > `Sketchbook location` from the menu bar in the Arduino IDE.
131
+
132
+
### How to Install ESP32_IO_Expander in Arduino IDE?
133
+
134
+
- **If users want to install online**, navigate to `Sketch` > `Include Library` > `Manage Libraries...` in the Arduino IDE, then search for `ESP32_IO_Expander` and click the `Install` button to install it.
135
+
- **If users want to install manually**, download the required version of the `.zip` file from [ESP32_IO_Expander](https://github.com/esp-arduino-libs/ESP32_IO_Expander), then navigate to `Sketch` > `Include Library` > `Add .ZIP Library...` in the Arduino IDE, select the downloaded `.zip` file, and click `Open` to install it.
136
+
- Users can also refer to the guides on library installation in the [Arduino IDE v1.x.x](https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries) or [Arduino IDE v2.x.x](https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-installing-a-library) documentation.
0 commit comments