// ── Arduino Uno R3 — External LED Blink ──────────────────────────────────────
// Blinks an LED on pin 9 with a configurable period.
// Modify ON_MS and OFF_MS to change the flash pattern.
// ─────────────────────────────────────────────────────────────────────────────
#define LED_PIN 9 // Digital pin connected to LED anode (via 220Ω)
#define ON_MS 500 // How long the LED stays on (milliseconds)
#define OFF_MS 500 // How long the LED stays off (milliseconds)
void setup() {
// Tell the ATmega this pin should drive current (output mode)
pinMode(LED_PIN, OUTPUT);
// Optional: open Serial so you can watch the blink count in the monitor
Serial.begin(9600);
Serial.println("Blink sketch started");
}
void loop() {
// HIGH drives the pin to 5V → current flows → LED lights up
digitalWrite(LED_PIN, HIGH);
Serial.println("LED ON");
delay(ON_MS);
// LOW pulls the pin to 0V → no current → LED off
digitalWrite(LED_PIN, LOW);
Serial.println("LED OFF");
delay(OFF_MS);
}