Blinking LED
1. My first project was using the Arduino starter kit to complete the Blinking LED circuit. The goal is to make the right connections and code so the LED light will repeatedly blink on for one second and stop for one second. A more in-depth explanation is provided in the video below titled Blinking LED: My First Circuit.
2. Screenshot of Blinking LED code.
3. Picture of the circuit including Arduino and Breadboard.
4. Electronic Diagram
5. Video explaining the project and how it works.
.
Circuit Play
- What
happens if you turn the LED around (reverse the wiring)?
When I turned the LED
around, the LED does not light up.
- What
happens if you remove the positive lead from the breadboard? Does the
circuit still work?
When I removed the
positive lead from the breadboard the LED continues to blink.
- What
happens if you place the resistor to the positive side of the LED and
simply used a wire to run back from the LED to ground? When you do this,
you will need to change up the wiring a little so check this closely to
make sure you have not shorted out the circuit.
When I placed the resistor of the positive side
of the LED, the LED does not light up. I then ran a jumper wire from the LED to
the ground the LED started flashing again and brighter than when using the
resistor.
- What
happens if you move the wire from port 13 to port 12 on the Arduino?
Moving the wire from
port 13 to port 12 will cause the LED to stop flashing. The coding would have
to be changed to port 12 for the LED to light up.
Code Play
- If
you moved the wire from port 13 to port 12 on the Arduino, what do you
need to change in the code?
int led = 12;
- What
happens if you change the two delay code lines from delay(1000) to
delay(2000)? Take out a stop watch or timer of some sort and time the rate
of blinking for each of these settings. How many times does the LED blink
in a minute for each of these settings? What have you learned about the
value that is placed between the parenthesis after delay()? What value
(parameter) would you place in delay() if you wanted the LED to blink at a
rate of once every 3 seconds? How about every half second?
When changing the delay
code lines from delay(1000) to delay(2000)? The light blinks every two seconds
instead of one. The delay(1000) blinks 30 times in a minute, and the delay(2000)
blinks 15 times in one minute. The lower the number set in delay, the faster
the LED blinks. I learned the higher the number delay is set to, the slower the
LED blinks. The value (parameter) I placed in delay() to blink at a rate of
every 3 seconds is 3000. To get a blink rate of every half second is 500.
- What
happens if you place // before the words void setup()?
Placing // before the
words void setup() breaks the code. // is used for comments and is not read by
the code.
- What
happens if you place // before the words void loop()?
Placing // before the
words void loop() breaks the code.
- What
happens if you remove the last curly brace “}” in the program?
The code will not run if
you remove the last curly brace “}” in the program.
- What
happens if you place a // before pinMode(13,HIGH) in setup()?
The code will not be
read because // is read as a comment.
- What
happens if you changed HIGH to high on the pinMode(13,HIGH) line?
The LED will not come on
because “high” is not recognized.
- What
happens if you change the word pinMode to pinmode in pinMode(13,HIGH)?
The code is not
recognized when I change the word pinMode to pinmode in pinMode(13,HIGH).
6. In video/text, explain how you started with the initial challenge and what your thinking was as you worked through the challenge project where the code and or the circuit was modified.
The challenge project was time consuming, but I didn't want to give up and accept defeat. I had no problem connecting the second LED, but I did have problems writing the code to make the second LED blink. I wasn't sure if I included the second pin in the same code line as the first one. Through trial and error, after a few hours I finally had two blinking LEDs. SUCCESS! I played with the delays of each light and I was finally satisfied when the LEDs were blinking at different rates because it reminds me of Christmas lights. Although frustrating and time consuming, this end result of the challenges were gratifying.
I am proud of what I accomplished this week. I began this class terrified and granted, I am still terrified, but I have achieved my first set of challenges. Reflecting back on the week I have learned I have to pay close attention to every detail on the circuit board and the codes. At this point I am not sure about possible extensions of this project into where I may find examples of similar programs/circuits in the real world. Christmas lights, and traffic lights are what comes to mind at this point. I'm sure as the course progresses I will have the ability to add to the list of possible programs/circuits in the real world.




No comments:
Post a Comment