Week14 - Interface and Application Programming

Write an application that interfaces with an input &/or output device"

CLASS WEB PAGE:
http://academy.cba.mit.edu/classes/interface_application_programming/index.html

DOWNLOAD FILES:
INPUT | OUTPUT

For this week assignment I chose to use and learn Processing an open source programming language and integrated development environment (IDE) built for the electronic arts, new media art, and visual design communities with the purpose of teaching the fundamentals of computer programming in a visual context, and to serve as the foundation for electronic sketchbooks. The language builds on the Java language, but uses a simplified syntax and graphics programming model.
First thing I have to do was the free download of the software. Then to start with it, I've done several resarches on the official website and internet because for me it's a new software to use. The approach with Processing wasn't difficult because it looks like Arduino IDE and the documentation is really wide.
In the page Learning Processing I found a series of simple exercises and explanations to understand concept like serial port reading, variables etc..


I decided to work more with sound taking inputs for my final project. This time, however, to improve the sound, instead of a buzzer, I put on my board a speaker of an old phone.

For my Interface I wanted to create a screen with a Ball that runs at half the screen from left to right when starts the sound.
To do it I repeat the tutorial in the following video.



Once whatched it I customized my interface changing in the sketch background color, size, position and velocity of the ball. Done that, I worked on the second step: the communication between Arduino IDE and Processing.
First I wrote the sketch with the IDE using a tone library. After I open my Processing sketch and I set the Serial Port "port = new Serial(this, Serial.list()[1], 9600);" to import from the IDE. So I runned the Sketch on arduino paying attention to closing the serial monitor on it (otherwise processing recognizes a busy port). Then I runned the sketch on Processing and it's possible hear the melody while the ball flowing!