Homework 1
Description
Create a blinking LED
Components
LED light
Board
Resistor
Code
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
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(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(1000); // wait for a second
}
Description
I built a single circuit using the directions on the website and picture as an aide. It was helpful for me to clarify how the board is constructed so that I can understand how the energy moves through my circuit.
I downloaded the programs and installed the correct drivers. And I was super excited when the little LED lit up. I am easy to please.
Code
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
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(5000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(5000); // wait for a second
}
Description
I changed the rate of blink for the LED to 5 seconds on then 5 seconds off.