/**
* @file sketch.ino
* @brief Main application file for SafeHome Smart Detection Unit
* @author Eduardo Ventura Chancafe
* @company SafeHome Smoke Detector Inc.
* @date 2025
* @version 1.0
*
* This sketch implements the SafeHome Smoke Detector prototype using ESP32.
* It utilizes Object-Oriented Programming principles and ModestIoT architecture
* for embedded applications.
*
* The system monitors gas levels using an MQ-2 sensor and provides visual alerts
* through LED indicators. Data is transmitted to remote servers via WiFi connectivity.
*
* Hardware Components:
* - ESP32 DevKit v4 (main controller)
* - MQ-2 Gas Sensor (smoke/flammable gas detection)
* - LED with resistor (visual alert indicator)
* - WiFi connectivity (data transmission)
*
* Key Features:
* - Real-time gas monitoring with configurable thresholds
* - Visual alert system with multiple LED patterns
* - WiFi connectivity with automatic reconnection
* - JSON-based data transmission to cloud servers
* - Object-oriented architecture following ModestIoT principles
*/
#include "Config.h"
#include "Device.h"
// Create main device instance
Device smokeDetector;
/**
* @brief Arduino setup function - initialize the smoke detector device
*
* This function is called once when the device starts up.
* It initializes all hardware components and establishes network connectivity.
*/
void setup() {
// Initialize the SafeHome Smart Detection Unit
smokeDetector.setup();
}
/**
* @brief Arduino loop function - main device operation cycle
*
* This function is called continuously in a loop.
* It handles sensor monitoring, alert management, and data transmission.
*/
void loop() {
// Execute main device operations
smokeDetector.loop();
}