Saturday, March 3, 2007

Lab 5 - Serial and Talking to Processing

This lab proved to be the most trying in terms of getting it all to work properly. It was also the first lab I worked on with other class members which was a nice change. Fortunately for us, the issues were easily resolved with the help of the resident researchers. My first problem was that I couldn't get Terminal to communicate with my Arduino. It turned out that I had left out the word "screen" when prompting the Terminal to find a serial port.
The next snag was getting Processing to communicate with the Arduino. After a web search, Charley found that in Mac OSX, a Terminal command was needed to get access to the serial ports. After that we got the program to run as intended and started to change parameters in the code.



After some fun moving the ball around in the box, I thought that it would be neat if the ball could draw. Charley, having taken a class about Processing, fiddled with the code so that the ball would draw. Lucia then added to the code so that the ball had further range of motion and then I adjusted the size of the ball as well as the size of the drawing space to compensate for the potentiometer range.
When we initially wrote the code, we were using a pot and a photoresistor. I decided that the photocell didn't give enough precision when drawing so I swapped it out for another pot. Knowing that this week's topic was enclosures, I whipped up a little box to hold the breadboard and attached some knobs on the pots so that the controls would be easier.


before.

after.


Here is a video of the application in action.

No comments: