DESCRIPTION
I changed the default code so that my light would blink rapidly 3 times every 5 seconds.
COMPONENTS
1- Arduino Uno
1- Breadboard
1- Red LED
1- 220 Ohm Resistor
CODE
/*
Blink
makes the LED blink 3 times quickly, then a longer delay before looping
*/
// assiging LED to pin 13
int led = 13;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// makes the LED blink 3 times quickly, then a longer delay before looping
void loop() {
digitalWrite(led, HIGH); // turn the LED on for 100 mSec
delay(100);
digitalWrite(led, LOW); // turn the LED off for 100 mSec
delay(100);
digitalWrite(led, HIGH); // turn the LED on for 100 mSec
delay(100);
digitalWrite(led, LOW); // turn the LED off for 100 mSec
delay(100);
digitalWrite(led, HIGH); // turn the LED on for 100 mSec
delay(100);
digitalWrite(led, LOW); // turn the LED off for 5 sec
delay(5000);
}
- Login to post comments