blog

pcomp lab #1: fun with LEDs

i was really intimidated by this first pcomp assignment.  i have a tenuous grasp of electronics and wasn't sure i understood the principles enough to make the project work.  however, it really didn't turn out to be as bad as i thought it would be, a couple of minor issues aside. setting up the board wasn't a problem, and it turned out that it actually did make sense to me logically.  here's a photo of my initial finished breadboard/arduino:

next, i wrote the code following the template from class and from the adruino website.  i ran the program and was excited when one LED immediately came on.  however, when i pushed the switch, nothing happened.  video of the first attempt below:

i fiddled around with the code, thinking that i did something wrong there.  nothing.  i even followed the template to the character on the arduino website, still nothing.

finally, i examined the diagram on the pcomp site and found the problem -- one of my resistors was in the wrong place!  i had accidentally inserted the left end of the switch resistor on the positive side rather than the negative side.  amazing how moving it over just one spot will change the entire way the code runs.  i moved the resistor, tried the code again, and this time it worked like a charm.

PComp Lab #1 - LED and switch work! from Roopa Vasudevan on Vimeo.

next, i decided to fiddle around with delays and blinking.  i took out the switch input and instead wrote new code to reflect this.  video below -- during which i change the code in order to slow up the blinking a little bit.  (as you can tell, i was thrilled when it worked.)

LED Blinking from Roopa Vasudevan on Vimeo.

i still think i need to do some additional reading about the principles behind this to make sure i fully understand what's going on as far as current, voltage, etc.  but it was a big relief to see that i could make this work and it makes me look forward to more advanced physical computing in the next few weeks!

pcompRoopa Vasudevan