Making Furniture Interactive

September 6, 2007

Imran’s Exercise 1

Filed under: Exercise 1: What Is?,Imran Sobh,Students — imranixd @ 12:02 am

Chit chat club

This is a project done by people at the sociable media group at MIT. It allows people to embody furniture in a cafe to interact with the people sitting there. more info

Rocking Chair

The rocking of the chair itself might be seen as interactve. There is some behavior that a person is doing, and the chair responds my rocking back and forth. There is also a built in light.

image

September 4, 2007

Imran’s Exercise 0

Filed under: Exercise 0: Make A Lamp,Imran Sobh,Students — imranixd @ 2:00 pm

This exercise was a good introduction to get at the basics of how to make furniture “interactive.” I started out just trying to get three lights to light up using the default loop example. This involved some trial and error to simply get the correct components in the circuit. I’m still unsure what kind of resister is appropriate and if it is overloading the LED or not.


The next challenge was to apply them to something physical. I bent the wires and pins going into the LED to make them hook into each other. This made it so that they would be touching all the time. There’s probably a better way to do this.


I decided to change the default programming in the example to get the LEDs to fade and do other behavior. After some frustration, I found out that fading only works with the slots on the board that have PWM written next to it. Apparently these are analog slots.


The final program fades in each light, then flickers out of synch with an LED on the bread board. Over time, the delay between flickers gets shorter until it can’t get any shorter, then gets longer and repeats this forever.

Code:

int value = 0; // variable to keep the actual value
int ledpin = 3; // light connected to digital pin 9
int ledpin2 = 5;
int ledpin3 = 6;
int ledpin4 = 9;
int tweenDelay = 500;
boolean goingDown = true;

void setup()
{
// nothing for setup
}

void loop()
{

if(tweenDelay==0)
{
goingDown = false;
}
if (tweenDelay==500)
{
goingDown = true;
}

if(goingDown)
{
tweenDelay-=100;
}

if(!goingDown)
{
tweenDelay+=100;
}

for(value = 0 ; value <= 255; value+=20) // fade in (from min to max)
{
analogWrite(ledpin, value); // sets the value (range from 0 to 255)
delay(30); // waits for 30 milli seconds to see the dimming effect
}
for(value = 0 ; value <= 255; value+=20) // fade in (from min to max)
{
analogWrite(ledpin2, value);
delay(30);
}
for(value = 0 ; value <= 255; value+=20) // fade in (from min to max)
{
analogWrite(ledpin3, value);
delay(30);
}

for(int i=0; i<=3; i++)
{
allOff();
for(value = 0 ; value <= 5; value+=1)
{
analogWrite(ledpin4, value);
}
delay(tweenDelay);

allOn();
for(value = 4; value >=0; value-=1)
{
analogWrite(ledpin4, value);
}
delay(tweenDelay);

}

for(value = 255; value >=0; value-=5) // fade out (from max to min)
{
analogWrite(ledpin, value); // sets the value (range from 0 to 255) // waits for 30 milli seconds to see the dimming effect
analogWrite(ledpin2, value);
analogWrite(ledpin3, value);

}
delay(300);

}

void allOff()
{
analogWrite(ledpin, 0);
analogWrite(ledpin2, 0);
analogWrite(ledpin3, 0);

}

void allOn()
{
analogWrite(ledpin, 255);
analogWrite(ledpin2, 255);
analogWrite(ledpin3, 255);

}

« Previous Page

Create a free website or blog at WordPress.com.