Maker Challenge 1- Blinking LED Light
Project: Build a blinking LED circuit using the Arduino Starter Kit Guide- Create a circuit and write the code to make a LED light blink. I was not successful on the first try but after a few adjustments in the code I was able to get the LED blinking.
The Code:
My first attempt at the code was not successful because I did not install the software correctly and then I could not find the Arduino file. Once I found it, then I accidently closed it again.
Once I got everything installed correctly , I copied the code and I started working on the board.
I copied the code wrong at first and got several error messages. I changed one thing at a time and eventually got it working. -
Arduino Board Completed: I could not figure out how to get the circuit board onto the base; there was a clear plastic piece that had to be taken off.
Electronic Diagram:
Video Explanation of setup:
Video Explanation of wires and code connections:
Challenge Thinking: As I mentioned before, I did not get off to a great start; as I had trouble installing the program. I accidently downloaded the wrong one; once I found the correct one, then I could not find the folder to extract it into. My computer did not have the folder that it showed in the guide book; so I just saved the program into the Arduino folder. Once I got it installed , I opened the guide book and slowly one step at a time and read all about the different parts. I looked at the diagram in my book and got out all the parts I needed.
Completed board:
Once I had all the parts, then I started to look at the code. I had a few errors with the code. I did not have the brackets in the correct place, so I fixed those and moved the closed brackets to the top and bottom of each section of code.
Completed code:
I then went to compile my code with no errors and it still did not work. So I adjusted the wires and it started blinking!
Video:
Once I completed the initial challenge, I moved onto the Challenge Project with changing the circuit and the code.
When complete the Wire and Code play, I felt pretty confident. I felt I really understood how the code and wires worked together.
Wire Play:What happens if you turn the LED around (reverse the wiring)? Doing this made the LED light stop working because like a battery the positive and negative ends have to connect to the right sides.
What happens if you remove the positive lead from the breadboard? Does the circuit still work? This did not affect the blinking LED at all; with either end disconnected or both ends disconnected. I don't think this wire is actually doing anything.
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 As I mentioned before; you need to change the code to 12 because the wire is in port 12. You need to do this because the wire is now in 12 so the code needs to be 12 so they link up together.
Video: 3000
What happens if you place // before the words void setup()? This gives you an error message - expected error constructor, destructor, or type conversion before '(' token
What happens if you place // before the words void loop()?This gives you the same error message as the previous change.
What happens if you remove the last curly brace “}” in the program? This makes the light stop working and gives an error message; I think that this is what closes the code, so essentially the code is not closed.
What happens if you place a // before pinMode(13,HIGH) in setup()? This gave no error message but the light seemed to dim.
What happens if you changed HIGH to high on the pinMode(13,HIGH) line? This gave an error message that said high not detected and it suggested sinh. HIGH is the voltage level.
What happens if you change the word pinMode to pinmode in pinMode(13,HIGH)? This gives an error message that says suggested pinMode
Extended Challenge: I honestly thought this would be a lot easier and I struggled for quite some time and I think I kept making the same mistake. I kept getting errors for resistors because I just duplicated the code for a second LED below the second code.
I did however figure out the board right away! I knew it already had ground power so I did not need to add another black and red wire. I added another green wire and put it into port 12 and e4 on the breadboard. Then I added an LED to d4 and 5, then a resistor to a5 and -9.
Once I played with moving the code around and reading in my book; I realized I needed to move the pinMode 12 code under the pinMode 13 output.
Then left the duplicated digital write 12 code below the 13.
This made my lights blink at alternate rates.
To make the Led lights blink at the same time I moved the code for the second light under the same type of code for the first light.


Comments
Post a Comment