// #define BLYNK_TEMPLATE_ID "TMPL63a3uzc5S"
// #define BLYNK_TEMPLATE_NAME "Home Automation"
// #define BLYNK_AUTH_TOKEN "tOU7oidMTjenfZ3KHd67rTBffV4hNb17"
// #include <WiFi.h>
// #include <WiFiClient.h>
// #include <BlynkSimpleEsp32.h>
// // Blynk credentials
// char auth[] = BLYNK_AUTH_TOKEN;
// char ssid[] = "Wokwi-GUEST";
// char pass[] = "";
// BlynkTimer timer;
// // Pin definitions
// const int relayPin = 19; // Relay control pin
// const int irSensorPin = 34; // IR sensor input pin
// const int buzzerPin = 23; // Buzzer output pin
// const int buttonPin = 22; // Push button input pin
// // State variables
// bool buzzerOn = false;
// // #define button1_vpin V1
// // BLYNK_CONNECTED() {
// // Blynk.syncVirtual(button1_vpin);
// // }
// // Blynk relay control
// BLYNK_WRITE(V1) {
// int relayState = param.asInt();
// relayState = !relayState; // Get the relay state from Blynk app
// digitalWrite(relayPin, relayState);
// }
// void setup() {
// // Debugging serial
// Serial.begin(115200);
// // Initialize Blynk
// Blynk.begin(auth, ssid, pass);
// // Initialize pins
// pinMode(relayPin, OUTPUT);
// pinMode(irSensorPin, INPUT);
// pinMode(buzzerPin, OUTPUT);
// pinMode(buttonPin, INPUT_PULLUP); // Assuming push button pulls to ground when pressed
// // Set initial state
// digitalWrite(relayPin, HIGH); // Relay off
// digitalWrite(buzzerPin, LOW); // Buzzer off
// }
// void loop() {
// Blynk.run(); // Run Blynk
// // Check the state of the IR sensor
// if (digitalRead(irSensorPin) == HIGH) { // Object detected
// if (!buzzerOn) {
// digitalWrite(buzzerPin, HIGH); // Turn on the buzzer
// buzzerOn = true;
// }
// }
// // Check the state of the push button
// if (digitalRead(buttonPin) == LOW) { // Button pressed
// if (buzzerOn) {
// digitalWrite(buzzerPin, LOW); // Turn off the buzzer
// buzzerOn = false;
// }
// delay(500); // Debounce delay
// }
// }