Arduino Part 1

For this assignment, Aditi and I began to learn to code an Arduino with LEDs. Beginning to code with the Arduino was enjoyable, but challenging. Although difficult now, working with the Arduino seems like something that will become more enjoyable with practice. Because neither of us had done very much coding, there were many little mistakes and lots of trial and error that made the process slow. In the last part of this assignment, we struggled when trying to adjust the code to make multiple LEDs blink at different rates using the potentiometer. Although in the end we were able to make the lights blink, the code did not behave the way we intended it to. When we tried to change the blink rate of one LED, a different one would change leading us to believe that there is an error in our sketch. As we move on to Part 2, I hope to more fully understand the process behind writing the code, so that I will be able to use that knowledge in the future.

Modifying the Blink Sketch to have a Delay of 10:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The delay function is the amount of time the arduino waits before performing the next line of code. In this language, the unit of the delay function is in milliseconds (10-3 seconds). When we set the delay to 10, the arduino is turning the LED on and off every 0.01 seconds. This flashing is too quick for our eyes so process, so we see the light as continuously on.

 

Creating a Circuit with 3 LEDs blinking at different rates:

 

 

 

 

 

 

 

 

 

Use a potentiometer to change the LED blink rate based on the resistance of the potentiometer:

 

 

Creating a Circuit with 3 LEDs blinking at different rates without using the delay() function:

 

 

Print Friendly, PDF & Email
2 Comments
  1. I was comparing your code to mine, and I found that on the last part, we varied our blinking conditions the same way by multiplying by an integer! Also, I like how thoroughly commented your code was. It was very easy to follow.

Leave a Reply