Monday, March 9, 2015

Arduino Day 2

The Assignment:
We were challenged to go more in-depth with the Arduinos and to further explore the ideas of feedback and control with the programs knob and sweep, as well as create a program that responds to a photo cell.

Sweep:
After showing our final blink patterns, we connected the arduino to a device called a servo, which consists of a lego motor with rotating disk attached to it. The Servo was controlled by a program called Sweep. Below is the base program provided by the arduino site which commands the servo to turn back and forth 180 degrees at a rate of 1 degrees every 15 ms.



Knob:
The knob program correlates the amount the knob, also called a potentiometer, was turned with the blink rate of LED. The base program is shown below. Notice how the range of the potentiometer had to be changed from 0 - 1023 to 0 - 180 degrees to make its units familiar to us.





Photocell Program:
The photocell program that we wrote told the led light to turn on when a certain set value of "darkness" was reached as measured by the lego light sensor.





Reflection:
I am constantly amazed by the complexity of the computer coding language. Each line has a very specific job, that will not allow the program to function properly if it is not written correctly. I found it incredibly helpful to be forced to go through each line and what it does to the program. Otherwise, the lines remain very abstract and indecipherable things.  

No comments:

Post a Comment