WEEK 16

INTERFACE AND APPLICATION PROGRAMMING




Create an interface with an input or output device




For this assignment, students were asked to write an application that interfaces with an input and/or output device, comparing as many tool options as possible.
I decided to work with two different architecture: workflow and coding. Meanwhile, for the workflow system, I continued to use grasshopper + firefly, since I will use both of them in my final project, I started to code also something in java.





Workflow system : Grasshopper + Firefly

I decided to use simple outputs, such as a potentiometer/knob and a LDF, assembled on a breadboard and connected to ArduinoUno. I remind to flash Arduino with Firmata, available here. After that, I opened a new Rhinoceros file and Grasshopper. I used some firefly component to detect and activate the port which I used to communicate, then I used ArduinoRead component to read the input which range is from 0 to 1023, which can be easily remapped using Remap component. Then I connected the input data to a ValueTracker. To make the values more smooth, it is recommended to use Smoothing Temporal component. I have attached a video below. The Grasshopper definition is available here.



Programming with Processing

I wanted to create something with Java language, using Processing to compile. Since I am not very familiar with programming, it took me a lot of time to understand how to begin. First of all, I downloaded the package from the website, here. I also read how to make electronic components like sensors to communicate with Processing, using the serial port (trough a USB cable) Here is a very complete guide about it.



After installing and reading the basic about Processing, I loaded the sketch into Arduino and checked if the value were receiving correctly, just opening the serial monito from Arduino IDE. Then I loaded this sketch into Processing, changing the port, which I checked through the terminal, and some values.







Then, thanks to this tutorial, I undestood mostly how compile a simple sketch. I used a knob connected to arduino with remapped values ( from 0-1023 to 0-255 ). At the beginning I wanted to do something with the brightness, but then I decided to use the values to increase/decrease the lenght of a bar, which I created whit rectangule command on Processing. Here is a video of the outcome.





After that I tried to play with a LDR, using its value to rotate a shape and change the brightness value.






DOWNLOAD FILES


InterfaceArduinosketch.ino
Processingsketch.pde