const int inputPins[] = {2, 3, 4, 5, 6, 7, 8}; // Define the input pins
const int outputPin = 9; // Define the output pin
const int buzzerPin = 10; // Define the buzzer pin
void setup() {
// Initialize input and output pins
for (int i = 0; i < 7; i++) {
pinMode(inputPins[i], INPUT);
}
pinMode(outputPin, OUTPUT);
pinMode(buzzerPin, OUTPUT);
}
void loop() {
// Check if any input is high
for (int i = 0; i < 7; i++) {
if (digitalRead(inputPins[i]) == HIGH) {
// If any input is high, set the output and trigger the buzzer
digitalWrite(outputPin, LOW);
beepBuzzer();
delay(500); // Delay to avoid continuous triggering
return; // Exit the loop
}
}
// If no input is high, turn off the output and buzzer
digitalWrite(outputPin, HIGH);
digitalWrite(buzzerPin, LOW);
}
void beepBuzzer() {
digitalWrite(buzzerPin, HIGH);
delay(100); // Beep duration
digitalWrite(buzzerPin, LOW);
}
this is my code i add standby mode to output pin 9 is 10 minits are automatic off and any input are low can this program run continually and reset time if u have any idea