Description
I made an LED flash five times per second.
Components Used
List what you used in your assignment.
Example:
1- Arduino Uno
1- 220 Ω Resistor
1- Breadboard
1- Red LED
Code
/*
Blink
Turns on an LED on for a tenth of a second, then off for a tenth a second, repeatedly.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
}
Images
http://i42.tinypic.com/t53v38.jpg
- Login to post comments