uploaded 5 months ago
IO_MetaHouse: ESP32 relay and button module handler.

readme

# IO_MetaHouse

IO_MetaHouse is a C++ component for handling relay and button modules on ESP32 devices.

## Overview

IO_MetaHouse provides classes for interfacing with relay modules and button modules on ESP32 microcontrollers. It includes two main classes:

- `RelayModule`: Interface for controlling relay power states.
- `ButtonModule`: Interface for handling button events like single press, double press, and long press.

## Features

- Control relay power states.
- Handle button events such as single press, double press, and long press.
- Simple to integrate into ESP32 projects.

## Installation

Clone this repository into your ESP32 project components directory:

```bash
git clone https://github.com/your/repository.git components/IO_MetaHouse
```

## Usage

### RelayModule
```cpp
#include "RelayModule.hpp"

// Create a relay module instance
RelayModule relay;

// Set the power state of the relay
relay.setPower(true); // Turns the relay on

// Check if the relay is on
bool isOn = relay.isOn();
```

### ButtonModule
```cpp
#include "ButtonModule.hpp"

// Create a button module instance
ButtonModule button;

// Register callbacks for button events
button.onSinglePress([](void *param) {
    // Callback for single press
});

button.onDoublePress([](void *param) {
    // Callback for double press
});

button.onLongPress([](void *param) {
    // Callback for long press
});
```

## Dependencies
 - ESP-IDF: ESP32 IoT Development Framework

## License
This project is licensed under the [MIT License](LICENSE) - see the LICENSE file for details.

Links

  • Repository Repository

Supports all targets

License: MIT

To add this component to your project, run:

idf.py add-dependency "ronny-antoon/io_metahouse^4.1.0"

or download archive

Stats

  • Archive size
    Archive size: 3.95 KB
  • Downloaded in total
    Downloaded in total 8 times
  • Downloaded this version
    This version: 2 times

Badge

ronny-antoon/io_metahouse version: 4.1.0
|