You will write a program to make the LED blink.
Software Discovery: Constants, Digital Output
Other Discovery: LED
Qty Part
1 LED
1 Resistor [150Ω]
Software Discovery: Constants, Digital Output
Other Discovery: LED
Qty Part
1 LED
1 Resistor [150Ω]
Resources: |
|
int led = 3; // LED connected to digital pin 3
void setup() // run once, when the sketch starts
{
pinMode(led, OUTPUT); // sets the digital pin as output
}
void loop() // run over and over again forever
{
digitalWrite(led, HIGH); // turn the LED on
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off
delay(1000); // wait for a second
}
Challenge Yourself!
Watch the video on Nature's Firework.
We admire how tails of fireflies glow. Observe the how the light at its tail flickers. Can you emulate the fading of fireflies using Arduino?
You can use the same setup in this experiment to gradually fade the brightness of the LED using a few simple lines. Adjust the sketch to your desired outcome.
(Hint: File > Examples > Basics > Fade)
If you are more adventurous, try out this Arduino Firefly Jar project!
Watch the video on Nature's Firework.
We admire how tails of fireflies glow. Observe the how the light at its tail flickers. Can you emulate the fading of fireflies using Arduino?
You can use the same setup in this experiment to gradually fade the brightness of the LED using a few simple lines. Adjust the sketch to your desired outcome.
(Hint: File > Examples > Basics > Fade)
If you are more adventurous, try out this Arduino Firefly Jar project!