16. Interface and application programming

This week I worked on practicing programming.

Research 1: Write an application that interfaces a user with an input/output device i made.

Practice 1:

I started researching the software Processing. I download the software for Mac OS X This processing language is based on Java.

Processing

The screen of the first image is :

I start practicing for the first time looking for a tutorial and i make an ellipse. The parameters are:

Horizontal direction Vertical direction Lenght Width
50 50 80 80
50 50 60 80
50 50 80 60

Practice 2:

As a second exercise i programm how to make intuitive circuits by using the mouse, testint different values.

Here found the Code for Processing:

Processing using mouse for doing circles from Manuel Corrales Arana on Vimeo.

After learning how processing works, i started with my task.

Both programs in parallel and the idea is that the information given in processing will run the code in Arduino. I want to use 4 squares that represents buttons in Processing to make an RGB Led turn on using different color of lights programmed in Arduino. So, when i press the square labelled “red”, the red light turns on, when preseed the square labelled “blue” the blue light will turn on, but before i have to turn off after a light is on to continue with the next one, ans so on.

Here the image of both codes.

Links of:

Arduiono’s Code

Processing’s Code

Input used as buttons done in processing and as output the RGB Led which turns on and off according to the programming.

And finally it works as shown in the video.

Interface using Processing and Arduino - RGB Led from Manuel Corrales Arana on Vimeo.

Research 2: Group Assignment: Compare as many tools as possible

I research the interface between Scratch and Arduino and it is possible.

Step 1: Download Sratch for Arduino S4A

Download the firmware for Arduino from the page above.

This window will appear and the programmins is simple due to the use of blocks.

Interface using Scratch and Arduino - RGB Led from Manuel Corrales Arana on Vimeo.

This work was very interesting for me because it let me understand how to deal with programming in different ways to arrive to the same idea. Another important issue was to understand how Arduino can work together with Processing communicating by themselves.