ESP32++ (esp32pp) is a personal collection of C++ classes designed for use with ESP32 microcontrollers. This library is intended to simplify and enhance the development process on the ESP32 platform by providing a powerful set of reusable components.
- Button: Class for handling button input.
- CriticalSection: Safe handling of critical sections.
- DHT: Interface for DHT sensors.
- HttpServer: Basic HTTP server functionality.
- I2C: Simplified I2C communication.
- Ina226: Driver for INA226 power monitor.
- LedStrip: Control for LED strips.
- RF433: Interface for RF433 modules.
- Task: Task management utilities.
- WiFiStation: Easy Wi-Fi connection management.
Clone the repository:
git clone https://github.com/realsba/esp32pp.git
cd esp32pp
Ensure you have ESP-IDF installed and properly configured:
. $HOME/esp/esp-idf/export.sh
Then, build the project using CMake:
idf.py build
You can use the provided examples to get started with each component.
For instance, to use the Button class, include it in your project:
Edit the CMakeLists.txt file in your main/ directory to include the Button component:
idf_component_register(
SRCS main.cpp
REQUIRES Button
INCLUDE_DIRS .
)
In your main.cpp or main.hpp, include the Button class:
#include "Button/Button.hpp"
Now you can instantiate and use the Button class in your application:
Button myButton(GPIO_NUM_0); // Example using GPIO 0
myButton.setPressedHandler([](){
// Action on button press
});
idf.py build
idf.py flash
esp32pp/
├── Button/ # Button handling classes
├── CriticalSection/ # Critical section management
├── DHT/ # DHT sensor interface
├── HttpServer/ # HTTP server implementation
├── I2C/ # I2C communication
├── Ina226/ # INA226 power monitor driver
├── LedStrip/ # LED strip control
├── RF433/ # RF433 module interface
├── Task/ # Task management utilities
├── WiFiStation/ # Wi-Fi connection management
├── examples/ # Example projects
├── main/ # Main application code
├── CMakeLists.txt # CMake build configuration
└── sdkconfig # ESP-IDF SDK configuration
- ESP-IDF: The official development framework for ESP32.
- CMake: Build system generator.
Contributions are welcome! Feel free to open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Bohdan Sadovyak
Please report any bugs or issues here.