// Define the LED pin
const int ledPin = 2;
// Setup function runs once when the microcontroller starts
void setup() {
// Initialize the digital pin as an output
pinMode(ledPin, OUTPUT);
}
// Loop function runs continuously
void loop() {
// Blink the LED five times
for (int i = 0; i < 5; i++) {
digitalWrite(ledPin, HIGH); // Turn the LED on
delay(500); // Wait for 500 milliseconds
digitalWrite(ledPin, LOW); // Turn the LED off
delay(500); // Wait for 500 milliseconds
}
// Stop the loop by keeping the LED off
while (true) {
digitalWrite(ledPin, LOW); // Ensure the LED is off
}
}