Update README.md
This commit is contained in:
@@ -11,9 +11,65 @@ Full-featured custom component for the **TCA6408** 8-bit I
|
|||||||
- Polling fallback mode
|
- Polling fallback mode
|
||||||
- Compatible with ESP32 (including C3/C5/C6), ESP8266, etc.
|
- Compatible with ESP32 (including C3/C5/C6), ESP8266, etc.
|
||||||
|
|
||||||
|
The INT pin on TCA6408 is open-drain active-low — connect a pull-up resistor (or use internal pull-up on ESP).
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
1. Download or clone this component into your ESPHome project:
|
1. Download or clone this component into your ESPHome project:
|
||||||
```bash
|
```bash
|
||||||
mkdir -p custom_components
|
mkdir -p custom_components
|
||||||
cp -r TCA6408/custom_components/tca6408 custom_components/
|
cp -r TCA6408/custom_components/tca6408 custom_components/
|
||||||
|
## Basic Configuration
|
||||||
|
|
||||||
|
i2c:
|
||||||
|
sda: GPIO4
|
||||||
|
scl: GPIO5
|
||||||
|
scan: true
|
||||||
|
frequency: 400kHz
|
||||||
|
|
||||||
|
custom_components:
|
||||||
|
- source:
|
||||||
|
type: local
|
||||||
|
path: custom_components/tca6408
|
||||||
|
|
||||||
|
tca6408:
|
||||||
|
- id: tca6408_hub
|
||||||
|
address: 0x20 # Default: 0x20 (0x20–0x27 depending on ADDR pins)
|
||||||
|
interrupt_pin: GPIO6 # Recommended for fast input response
|
||||||
|
|
||||||
|
## Example: Outputs (Switches)
|
||||||
|
|
||||||
|
switch:
|
||||||
|
- platform: gpio
|
||||||
|
name: "TCA6408 Output 0"
|
||||||
|
pin:
|
||||||
|
tca6408: tca6408_hub
|
||||||
|
number: 0
|
||||||
|
mode: OUTPUT
|
||||||
|
|
||||||
|
- platform: gpio
|
||||||
|
name: "TCA6408 Relay (Active Low)"
|
||||||
|
pin:
|
||||||
|
tca6408: tca6408_hub
|
||||||
|
number: 1
|
||||||
|
mode: OUTPUT
|
||||||
|
inverted: true
|
||||||
|
|
||||||
|
## Example: Inputs (Binary Sensors) with Interrupt
|
||||||
|
|
||||||
|
binary_sensor:
|
||||||
|
- platform: gpio
|
||||||
|
name: "Door Sensor"
|
||||||
|
pin:
|
||||||
|
tca6408: tca6408_hub
|
||||||
|
number: 3
|
||||||
|
mode: INPUT
|
||||||
|
inverted: true # Uses hardware polarity inversion
|
||||||
|
|
||||||
|
- platform: gpio
|
||||||
|
name: "Push Button"
|
||||||
|
pin:
|
||||||
|
tca6408: tca6408_hub
|
||||||
|
number: 4
|
||||||
|
mode: INPUT
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user