The goal of this week’s project was to design a computer interface for an input device. As I had a phototransistor board from awhile back, I wanted to make a computer interface that would respond to that board. I spent awhile learning basic processing at http://hello.processing.org/guide/ - which is an incredible resource! The videos are really helpful.
I tried it in two ways: First, I used the phototransistor board that I had made during input week and tested that. I got a little response in the window.
The timer seemed to be off so I then tried again on an arduino board to see if I could make a larger response on the computer interface.
This was the result.
To program the computer interface in python
import processing.serial.*;
Serial port;
float brightness = 0;
void setup()
{
size(500,500);
port = new Serial(this, "COM8", 9600);
port.bufferUntil('\n');
}
void draw()
{
background(0,255,brightness);
}
void serialEvent (Serial port)
{
brightness = float(port.readStringUntil('\n'));
}