Week two of physical computing sees us engaging with analog input devices, and using that input to drive an output. Specifically, we were asked to use a range of analog input devices to drive an LED. I chose to keep it simple and use a potentiometer and a photo sensor to drive a simple one LED setup. Not exactly intricate, but definitely to the point and capturing the essence of the idea.
The first task was to wire a potentiometer to the breadboard. In this picture you can see the potentiometer wired and connected to analog I/O zero, in this case as an input. After adding the potentiometer, I then added the LED to digital I/O nine, and set this port to output mode. You can see the LED in this photo as well, ready to act as a reflection of the potentiometer's position.
Using the provided lab code, the setup was validated, and the potentiometer used to control the LED. This can be seen in the video above.
Following the use of the potentiometer, we were encouraged to use another analog sensor to deliver a signal to the LED. In this case I chose a photosensor that comes with the ITP materials kit. At first (as can be seen in the above video), the sensor gave me passable, but suboptimal, results.
I discovered this was due to the fact that I was using an inappropriate resistor, and not massaging my input data in any way. By switching the resistor to more appropriately match the rating on the photosensor, and furthermore mapping top and bottom data input, I managed to coax the LED into reacting more smoothly to the input.
While this week's lab was certainly interesting, it seems like it could be easily combined with week one's lab. The principles are largely the same, and making the jump from digital to analog input isn't a large one. That being said, there is far more potential for experimentation with analog sensors that I failed to take advantage of: I'm planning on kicking that into gear with next week's Stupid Pet Trick.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment