Description
Use the Arduino to control a light emitting diode and turn it on every 0.5 seconds
Components Used
-
Light Emitting Diode (LED)
-
Resistor
/*
Blink
Turns on an LED on for 3 seconds, then off for 0.5 second, repeatedly.
This example code is in the public domain.
*/
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(3000); // wait for 3 seconds
digitalWrite(13, LOW); // set the LED off
delay(500); // wait for 0.5 second
}