Showing posts with label Processing. Show all posts
Showing posts with label Processing. Show all posts

Monday, January 4, 2010

Arduino code for four lasers

This is some of the code I am working on for the MFA project that I mentioned in the last post. Right now I simply have four photocells, each controlling an LED. Next week I plan to get one of these so that I can replace the lights with a triggered sound. This might require significant reworking of the code... we'll see.

First the video, then the code:



/*
Created 11 Dec 2009
By J Howell
modified 14 Dec 2009

*/

int ledPinA = 10; // LED connected to digital pin 10
int ledPinB = 11; // LED connected to digital pin 11
int ledPinC = 6; // LED connected to digital pin 11
int ledPinD = 5; // LED connected to digital pin 11
int val0; // define variable for photoresistor 0
int val1; // define variable for photoresistor 1
int val2; // define variable for photoresistor 1
int val3; // define variable for photoresistor 1
int ledBrightness; //


void setup()
{
Serial.begin(9600); // sets the serial port to 9600
}

void loop()
{
val0 = analogRead(0); // read analog input pin 0
val1 = analogRead(1); // read analog input pin 1
val2 = analogRead(2); // read analog input pin 2
val3 = analogRead(3); // read analog input pin 3

if( val0 < 400){
// fade in from min to max in increments of 1 points:
for(int fadeValue0 = 0 ; fadeValue0 <= 255; fadeValue0 +=1) {
// sets the value (range from 0 to 255):
analogWrite(ledPinA, -(fadeValue0));
}
}
else{
digitalWrite(ledPinA, LOW);
delay(10);
}
if( val1 < 400){
// fade in from min to max in increments of 1 points:
for(int fadeValue0 = 0 ; fadeValue0 <= 255; fadeValue0 +=1) {
// sets the value (range from 0 to 255):
analogWrite(ledPinB, -(fadeValue0));
}
}
else{
digitalWrite(ledPinB, LOW);
delay(10);
}

if( val2 < 400){
// fade in from min to max in increments of 1 points:
for(int fadeValue1 = 0 ; fadeValue1 <= 255; fadeValue1 +=1) {
// sets the value (range from 0 to 255):
analogWrite(ledPinC, -(fadeValue1));
}
}
else{
digitalWrite(ledPinC, LOW);
delay(10);
}
if( val3 < 400){
// fade in from min to max in increments of 1 points:
for(int fadeValue0 = 0 ; fadeValue0 <= 255; fadeValue0 +=1) {
// sets the value (range from 0 to 255):
analogWrite(ledPinD, -(fadeValue0));
}
}
else{
digitalWrite(ledPinD, LOW);
}
}

Saturday, December 19, 2009

Some recent work

I have been extremely negligent about publishing posts. Its nearing the end of 2009 and I'll go ahead and make my first new years resolution right now: I am going to try to update this blog at least twice per month.
There is actually quite a lot going on for me right now. I recently completed two sculpture projects for Cliff Garten Studio, the first a bench/sculpture at the new Sacramento Valley High School Library and the other is a collection of small columns in front of the Academy of Art University in North Hollywood. Both pieces use a simple array of stainless steel rods bent into the same profile and welded together at connection points. It is a very simple design which work well for these low budget projects, but I am pretty pleased with how they look when lit up at night. The Sacramento photos were taken by my friend Linda Dang.




I am also working with my friend Liz Terschurr on the design and electronics for the set of a dance performance this coming February at UCLA. The stage will be crisscrossed with visible laser beams that control sound effects. The dancers are choreographed to interrupt the beams at key moments and create a real-time background score for the performance. Essentially this is a larger version of this laser harp but the beams will actually cross parts of the stage rather than being confined to a small area. I will post some videos and the code I am working on shortly. As always comments and suggestions are appreciated since I am a bit rough in my knowledge of writing code.

Wednesday, May 28, 2008

Installation Update

A few images and video from the interactive installation I am working on with two other UCLA students. Using code written in processing, the servos will be controlled through an ultra-sonic proximety sensor. The box for the installation is divided up into 5 zones, each with its own servo. A single sensor is able to control behavior for all 5 servos separately based on distance of an object (person).


Wednesday, November 7, 2007

no images...

Its been over a month since I last posted, so I figured it was about time to get something new up. Unlike in previous quarters, it seems I no longer produce much visual work to post. I need to download a java applet so I can post some of the animations I have been doing for programming class. We started dealing with user interaction a few weeks ago and I have created a few simple programs which generate pattern and colors based on mouse movement and clicking.
I've been able to use a similar programming syntax to script part of my studio projects. I've decided to focus in on two simple areas for the time being: brick patterns and a woven screen. The bricks were fairly easy to deal with using a simply flow command to array a primitive (brick) along a surface. The next step I have started to address is rotating the bricks based on surface curvature at a given point. I'm looking to use the brick as more of a screen rather than opaque wall, so as the brick rotates it creates small openings in the surface of the skin.
The screen uses user inputed variables, controlling starting and ending diameter as well as middle diameter in both vertical and horizontal directions. I would like to make the variables in one direction user controlled, and then control the variables in the other direction based on diameter size at the intersection points. I haven't been fully successful with this yet...
I will try to get images posted soon. Review is on Friday, so I am being forced to produce!
In other news... Architecture in Helsinki concert tomorrow night!