Thursday, May 24, 2007

Summer Projects

I am going to connect my gesture board to a Jitter 3D environment. I also am going to try to connect it in Processing as well (3D also).

I am also creating my flash final in processing because flash could not handle the large array of URLs created in an RSS engine.

Thursday, May 10, 2007

Gesture Bread Board

I wanted the piece to be stand alone so I had to program the gesture recognition into the Arduino chip. There are libraries being created to do this but I have not heard much about their progress.

I'll explain the breadboard. I picked super bright LEDs because they are easy to see on video. I used 10x10 LED bars; they are neat and diffuse the light well so I went with them. I bought them on DIGIKEY. I placed the LED in the center of the breadboard due to their large size compared to the breadboards I have been using. Since each LED bar is actually four LEDs I needed a way to control all four LEDs at once. I did this by using a transistor, TIP-120s to be specific. Each TIP-120 controls one LED bar. I used 220 ohm resistors on the LEDs. I am not sure if that is the correct one but it was the best out of the selection I have. The normal red LED is just so I know the board is receiving power. Strapped to the underside is the Arduino board and a 9V battery. Both are powering the board, the Arduino is being powered via USB but that is easily changeable. I did not have time to solder the wires. The accelerometer is attached to the breadboard to provide some (although very little) stability. It then connects to the analog inputs of the Arduino. The digital outputs control the TIP-120 and therefore the lights. Note that the wire from the 9V to the breadboard is not there (normally connected to the volatage regulator).



Digital Life Moves On

So they hated my thesis proposal and then sent feedback that they liked it, but it needed work. (I was not going to build a prototype robot and have the idea shot down, so the comment I received about a lack of prototype is ridiculous) This made me more upset at the matter and I am giving up on this endeavor and coming up with something else. I'll revisit my "Alchemical Fire" project but use MAX/MSP/JITTER and Critter for better sound and gesture recognition. I'll experiment with that over the summer if I can get some place on campus to play around in. I'll contact the DAL and see if they have any room during the summer.

Our department has issues but then all departments do. They are having problems going from a production orientated program to a art orientated one. Like most Americans they went full swing and then some and forget that you can have art and technology together it does not have to be about one or the other.

PS Sorry for the cheesy blog title and this rant.

Friday, May 04, 2007

My Thesis Proposal Today

Thesis: Failure.

Anyone want +$12,000 of wasted thesis work and tuition?

Code Again

Here is the code for the breadboard gesture sensor. I actually commented it.


//Values for the LEDs
//top
int ledPin1 = 7;
//right
int ledPin2 = 8;
//bottom
int ledPin3 = 9;
//left
int ledPin4 = 10;
//power
int ledPinP = 13;
//Sensor Pins
//Accelerometer Analog Input
int sensorPinZ = 0;
int sensorPinY = 1;
int sensorPinX = 2;
//Values for sensosrs
int valX = 0;
int valY = 0;
int valZ = 0;
//values for gesture recognition
//creates a high number for the test value as to
// not trigger the loops
int testVal = 111;
//array to take it 100 points of data of X,Y,Z
int newMotion[100];
//this is a previously recorded swirl loop
int swirl[100] = {
202,414,397,199,416,405,198,420,410,194,420,414,191,420,
416,192,421,417,189,422,418,187,424,421,187,427,424,187,
432,426,185,434,430,186,440,434,185,445,439,187,451,444,
185,455,448,185,460,453,184,460,455,186,463,457,185,464,
460,187,465,461,190,467,463,192,467,464,192,469,465,195,
470,466,196,470,467,197,468,466,197,467,466,197,465,464,
197,464,462,195,462,460,197,462,460,198,461,460,198,461,
460,198};
//this is a previously recorder shake loop
int shake[100] = {
0,343,340,0,347,340,0,344,338,0,342,337,0,336,333,
0,333,329,0,324,323,0,317,317,0,310,311,0,306,307,
0,311,307,0,306,306,0,303,304,0,308,305,0,308,306,
0,308,307,0,309,308,0,309,309,0,314,311,0,315,314,
0,320,317,0,324,322,0,327,326,0,328,328,0,331,330,
0,333,333,0,334,335,0,337,337,6,338,339,13,341,341,
20,341,342,27,341,342,34,342,343,43};
//this are booleans to control the behaviors of the LEDS
boolean swirlGate = false;
boolean shakeGate = false;

void setup () {
//Declaring input and output
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
pinMode(ledPin4, OUTPUT);
pinMode(ledPinP, OUTPUT);
pinMode(sensorPinX, INPUT);
pinMode(sensorPinY, INPUT);
pinMode(sensorPinZ, INPUT);
//Setting up serial this is here to test the
//values and to calibrate it
Serial.begin(9600);
}

//the is a swirl checking function
void recognizeSwirl(){
for(int z = 0; z < 100; z++){
//check new array to old
testVal = abs(newMotion[z] - swirl[z]);
//Data for calibration
//Serial.println(testVal);
//if the test value is greater than 50 you are not
//swirling it. this variable should be calibrated
if(testVal<50) {
//if the value is less than 50 you are swirling it
swirlGate = true;
}
else {
//else you are not, end the loop
swirlGate = false;
z = 100;
}
}
}

//the is a swirl checking function
void recognizeShake(){
for(int z = 0; z < 100; z++){
//check new array to old
testVal = abs(newMotion[z] - shake[z]);
//Data for calibration
//Serial.println(testVal);
//if the test value is greater than 20 you are not shaking it.
//this variable should be calibrated
if(testVal<20) {
//if the value is less than 20 you are shaking it
shakeGate = true;
}
else {
//else you are not, end the loop
swirlGate = false;
z = 100;
}
}
}

//This function is used to light the correct LED
void lightMe(int l1) {
//PWM ramp up
for (int i=1; i<400; i++) {
digitalWrite(l1, HIGH);
delayMicroseconds(i);
digitalWrite(l1, LOW);
delayMicroseconds(i);
delay(3);
}
//PWM ramp down
for (int i=399; i>0; i--) {
digitalWrite(l1, HIGH);
delayMicroseconds(i);
digitalWrite(l1, LOW);
delayMicroseconds(i);
delay(3);
}
}

//flashing LED function
void otherlightMe() {
for (int i=0; i<10; i++) {
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin2, HIGH);
digitalWrite(ledPin3, HIGH);
digitalWrite(ledPin4, HIGH);
delayMicroseconds(i);
digitalWrite(ledPin1, LOW);
digitalWrite(ledPin2, LOW);
digitalWrite(ledPin3, LOW);
digitalWrite(ledPin4, LOW);

delayMicroseconds(i);
delay(5);
}
}

//primary loop function
void loop(){
//this is a power pin to know it is on
digitalWrite(ledPinP,HIGH);
//read 100 points of data
for(int i=0; i<100; i=i+3) {
newMotion[i] = analogRead(sensorPinX);
newMotion[i+1] = analogRead(sensorPinY);
newMotion[i+2] = analogRead(sensorPinZ);
}
//check if you are swirling it, this is done first
//in an if statement because arduino is odd
recognizeSwirl();
//if it is false see if you are shaking it
if (swirlGate == false) recognizeShake();
//swirl behavior
if (swirlGate == true) {
lightMe(ledPin1);
lightMe(ledPin2);
lightMe(ledPin3);
lightMe(ledPin4);
swirlGate = false;
}
//shake behavior
if (shakeGate == true) {
otherlightMe();
shakeGate = false;
}
}

Thursday, May 03, 2007

New Video

Finally I had time to create a new video. Here it is!!! I used a breadboard this time because my protoboard version is dead. This one seemed to work more consistently than the other. I will have more on my thesis once I am done proposing it tomorrow. I need to reduce the pictures to be more web friendly. So until next week...