/**
* AquaSense Smart Tank Controller
* Main Arduino sketch for IoT water tank monitoring system
*
* @author AquaSense Tech - U202211390
* @version 1.0
* @date 2024
*
* This sketch implements an intelligent water tank monitoring system
* using ESP32, ultrasonic sensor HC-SR04, and servo motor for valve control.
* Features automatic valve control based on water levels and remote monitoring.
*/
#include "AquaSenseSmartTank.h"
#include "ModestIoT.h"
// Global device instance
AquaSenseSmartTank* smartTank;
/**
* Arduino setup function
* Initializes the smart tank device and all components
*/
void setup() {
Serial.begin(115200);
Serial.println("=== Developer : Alexander Castillo - U202211390 ===");
Serial.println("=== Miembro del equipo: GreenWave Inc===");
Serial.println("=== AquaSense Smart Tank Controller ===");
Serial.println("Initializing system...");
// Create and initialize the smart tank device
smartTank = new AquaSenseSmartTank();
smartTank->setup();
Serial.println("System initialized successfully!");
Serial.println("Monitoring water levels...");
}
/**
* Arduino main loop function
* Continuously processes device operations
*/
void loop() {
if (smartTank != nullptr) {
smartTank->loop();
}
// Small delay to prevent overwhelming the system
delay(100);
}