Blinking led; Arduino
From cod3v
Introduction
The simplest possible LED system because this uses the Arduino UNO onboard LED at pin LED_BUILTIN.
Theory
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(500);
digitalWrite(LED_BUILTIN, LOW);
delay(500);
}
The commands pinMode configures the specified pin to behave either as an input or an output. This project uses it as an output. The LED_BUILTIN is pin number 13.
Exercises
- Use LEDs connected to other pins; perhaps you should use breadboard and current resisting resistor.
- Create Morse coded text.
- Create a metronome that blinks eg. 80 bpm.
- Blink according to a rhythm.