Version: 0.1
Author: IoT Solution Development Team
Date: September 08th, 2025
This project demonstrates the usage of the Modest IoT Nano-framework (C++ Edition) v0.1 by implementing a simple IoT device: the ToggableLedDevice. It toggles an LED on an ESP32 via a button press, showcasing the framework’s object-oriented, event-driven, and CQRS-inspired design. This example is not part of the core framework but serves as a practical illustration of how to apply it.
The framework itself is maintained separately in Modest-IoT-Nano-framework-Cpp.
- Hardware: ESP32 development board, a push button (active-low with pull-up), an LED with a 220Ω resistor.
- Software: Arduino IDE with ESP32 support, or Wokwi for simulation.
- Dependency: Modest IoT Nano-framework (C++ Edition) v0.1.
- Button Control: Pressing the button toggles the LED state.
- Event-Driven: Utilizes event handlers to manage button presses and LED state changes.
- Modular Design: Demonstrates the use of sensors, actuators, and devices in a structured manner.
- CQRS Pattern: Separates command handling (button press) from event handling (LED state change).
- Simulation Support: Can be run on Wokwi for easy testing and demonstration.
- Documentation: Includes user stories and a system diagram for clarity.
See user-stories.md for detailed user stories that guided the development of this example.
The following diagram illustrates the relationships between the nano-framework and the main classes in this example:
The class diagram can be found in class-diagram.puml.
- Download Framework: Clone or download
Modest-IoT-Nano-framework-Cpp. - Download Example: Clone or download this repository from avelasquezn/ToggableLedDevice-Example-Cpp.
- Directory Structure: Combine files (assuming both repos are siblings):
ToggableLedDevice-Example-Cpp/
├── ToggableLedDevice.ino
├── ToggableLedDevice.h
├── ToggableLedDevice.cpp
├── diagram.json
├── wokwi.project.txt
├── user-stories.md
├── class-diagram.puml
├── sketch.ino
├── (copied from Modest-IoT-Nano-framework-Cpp)
│ ├── ModestIoT.h
│ ├── EventHandler.h
│ ├── CommandHandler.h
│ ├── Sensor.h
│ ├── Sensor.cpp
│ ├── Button.h
│ ├── Button.cpp
│ ├── Actuator.h
│ ├── Actuator.cpp
│ ├── Led.h
│ ├── Led.cpp
│ ├── Device.h
│ └── Device.cpp