Week 13

Interface and Application Programming

Assignment

Individual assignment:
Write an application that interfaces with an input &/or output device that you made
Group assignment:
Compare as many tool options as possible


I will be focusing on Processing and write a program that will get information from my board.


I am trying with some of the examples.



I can then try and change the background color on the Mouse1D. This is done by changing the void draw - background to another number than zero.

Shapes

I played a bit around with some shapes.
I tried changing the position and the size of the shapes.
rect(x,y,h,w)
ellipse(x,y,h,w)
triangle(x1,y1,x2,y2,x3,y3)
The triangle feature needs more points because it has more edges.

Interactive shapes

I then tried with interactive shapes. When I moved the mouse over the screen it would drag circles after it.
The slower I moved the mouse, the closer the cirkles was placed.
I also tried with two shapes.

Testing with Arduino

I used this code in Arduino to test a potentiometor on a breadboard, connected to an Arduino Genuino Uno.
I then opened the Monitor. This opens a new window that will show the value it gets from the potentiometor when it is turned.
At first I couldn't get any information. I then found out that I had placed the VCC wire in the GND instead of 5V on the Arduino board.
After the problem was fixed I got these values when turning the potentiometor.
The first with values is with the green potentiometor.
The last with values is with the white and blue potentiometor.

Combining Arduino and Processing

I used these two codes.
The Arduino code is getting information from the potentiometor and sending it.
The processing code is controlling the size of the window that will open. It also controlls the brightness niveau and colour line 17) that you are changing by turning the potentiometor.


At the first try I couln't change the colours.



Then I closed both programs and uploaded the code to the Arduino board again, and then it worked!



I then tried changing the brightness colour.