Week 2 Maker spacer challenge

 1. Explanation of the project: 

The purpose of this week’s challenge is to use the potentiometer as a means to control the blinking of the LED light.  As the potentiometer is turned, the blinking speeds up or slows down. 

2. The following is the code that was used

The following is the code that was used. 

/* SparkFun Inventor's Kit

Example sketch 02

 POTENTIOMETER

void setup() // this function runs once when the sketch starts up

{

  // We'll be using pin 13 to light a LED, so we must configure it

  // as an output.

 

  // Because we already created a variable called ledPin, and

  // set it equal to 13, we can use "ledPin" in place of "13".

  // This makes the sketch easier to follow.

 

  pinMode(ledPin, OUTPUT);

void loop() // this function runs repeatedly after setup() finishes

{

  // First we'll declare another integer variable

  // to store the value of the potentiometer:

 

  int sensorValue;

  sensorValue = analogRead(sensorPin);   

  // Note that we're using the ledPin variable here as well:

  digitalWrite(ledPin, HIGH);     // Turn the LED on

  delay(sensorValue);             // Pause for sensorValue

                                  // milliseconds

  digitalWrite(ledPin, LOW);      // Turn the LED off

  delay(sensorValue);             // Pause for sensorValue

                                  // milliseconds

  // Remember that loop() repeats forever, so we'll do all this

  // again and again.

3.  Arduino and Breadboard



2. Here is an electron diagram and picture of the circuit board.

 


5. Visual explanation of the potentiometer 





Reflection on the Challenge 

Last week, I was clueless to the parts of the boards.  After watching an explanation of the board, I understood the purpose of each square and how to use the breadboard.  Now, the explanation of how to connect the wires are easier to understand.  I learned how to count and read the letters on the breadboard.  At first, it was intimidating because I just thought it was a white board with many holes. Now, I understand that purpose of the + and - and the other rows.  

As I started to build the challenge, I used the diagram to help me figure out how to match each wire and the resistors.  I learned quickly that the two prongs on the LED lights are not the same. I had to turn the light around to put the prongs in the opposite holes for it to light.  

The challenge was the potentiometer because mine looks different from the one in the visual.  Mine has two prongs on one side and one on the opposite side.  Some have three on one side.  It took awhile to figure out how to insert the prongs for it to work.  When I plugged it in, sometimes the light would speed up as I turned, and sometimes it did not.  

I would like to learn more about adjusting the codes on the program.  




1.     Additional Challenges:

Circuit and Code Play

1.      1. See what happens if you use two digital pins rather than on digital and one analog pin.

 It appears to slow down when the analog pin is pulled and replaced with two digital pins.  




2. See what happens if you use two analog pins rather than one digital and one analog pin.

The LED light stops working





3. What happens if you replace analogWrite with digitalWrite and vice versa?


The LED light stops working completely.  












Comments

Popular posts from this blog

Maker Spacer