Interface and application programming
Interfícies i programació d'aplicacions

assignment
write an application that interfaces with an input &/or output device

Temperature sensor interface
I tried to do some interface for my final project so I decided to learn some Processing. The idea was to connect the different sensors, a light sensor and a temperature sensor, and got the inputs values to interact with the servo motors. My first step was to get values from the serial. For this task you have to install the serial library. The Processing serial library allows for easily reading and writing data to and from external machines. You have to install it and then set the port where your arduino or fabduino is connected. To prove if the sensor is reading something you can write-down the line println(val); to see the values in the terminal. Also I tried the processing interface from this webpage to monitor temperature.
http://pscmpf.blogspot.com.es/2008/12/arduino-lm35-sensor.html
The interface it's very clear. You can see all the time the current temperature and also a graph with the variations in time.

Movie with the temperature interface working.


First test code, see the values in the terminal.


Step motors control interface
I also tried to do an interface using processing to control the motor degrees. For these I used the famous library controlP5 where you can find a big sort of sliders, buttons, etc. I modified the simple slider. This video shows how I could control the two step motors with independent sliders in a symmetrical way.

Movie with the steppers working.

 

The code for control the step motors

http://processing.org/reference/libraries/serial/
http://firmata.org/wiki/Download
http://processing.org/