Arduino, Cpp.
HIGH); // Activate the buzzer 3 times for (int i = 1; i <= 3; i++) { digitalWrite(buzzerPin, HIGH); delay(100); digitalWrite(buzzerPin, LOW); delay(100); } // Send a message to the Serial Monitor Serial.println("Motion detected!"); delay(100); } else { // No motion, keep the green LED on