A1: Blinking LED
Description:
Use Arduino to control an LED and modify the code to change the rate it blinks.
Components:
LED
Resistor
Code:
/*
Blink
Turns on an LED on for three seconds, then off for two seconds, repeatedly.
*/
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(2000); // wait for 2 seconds
}