Monday, May 31, 2010

Code Completion

const int groundpin = 18; // analog input pin 4 -- ground
const int powerpin = 19; // analog input pin 5 -- voltage
const int xpin = 2; // x-axis of the accelerometer
const int ypin = 1; // y-axis
const int zpin = 0; // z-axis (only on 3-axis models)
const int blueLed = 11; // output pin for blue LED
const int redLed = 10; // output pin for red LED
const int greenLed = 9; // output pin for green LED(not needed)
int Combine;
int x;
int y;
int z;
int x1;
int y1;
int z1;
int middlex;
int middley;
int middlez;


void setup() // Arduino only reads this part of the code once at the start
{

middlex = analogRead(xpin); //taking the value of the xpin

middley = analogRead(ypin); //taking the value of the ypin

middlez = analogRead(zpin); //taking the value of the zpin

analogRead(ypin);
analogRead(zpin);
pinMode(groundpin, OUTPUT);
pinMode(powerpin, OUTPUT);
digitalWrite(groundpin, LOW);
digitalWrite(powerpin, HIGH);

//sets pins for LEDs as outputs
pinMode(blueLed, OUTPUT);
pinMode(redLed, OUTPUT);
pinMode(greenLed, OUTPUT);
}
void loop()

{
//run tilitToLight function for each axis
tiltToLight(xpin, blueLed); //til to light up blue LED

}


void tiltToLight(int readFrom, int writeTo){
// subtracting the intial values of the x, y, z axis so the values return to zero when there is no movement

x = analogRead(xpin)-middlex;
y = analogRead(ypin)-middley;
z = analogRead(zpin)-middlez;

// using the abs function so that none of the values returned are below zero(abs function turns negative values into positive

x1 = abs(x);
y1 = abs(y);
z1 = abs(z);

Combine = (x1 + y1 + z1)/3; // combining each value from the x, y, z axis and dividing by 3 to get a value for the total acceleration



if (Combine < 0) {
Combine = 0;
}
else if(Combine > 255)
{
Combine = 255;}


analogWrite(redLed, Combine); // depending on the total combine value will determine the amount of red that will appear inside the RGB LED
analogWrite(blueLed, 255- Combine); // depending on the total combine value will determine how much blue will appear inside the RGB LED


}

Sunday, May 30, 2010

acrylic aesthetic




this was a test we did with arcrylic, it seems to emit they light extremely well so weve decided to stick with it. and john has cut they final shapes that need to be sanded in order to show the light travelling through they material

Monday, May 24, 2010

SENSOR ARRIVED

ARDUINO LILLYPAD ACCELEROMETER IS UP AND RUNNING!!!!!!!

Aesthetic testing




Different materials straws and plastic card

6th sense Video footage

Link to 6th sense wearable talk with TED

Project 1 Presentation


6th Sense Wearable Technology

'SixthSense' is a wearable gestural interface that augments the physical world around us with digital information and lets us use natural hand gestures to interact with that information.

This is the piece of wearable technology that i researched in order to give my 384 class i wider understanding of this type of technology. For a more indepth analysis of the project check out this link. http://www.pranavmistry.com/projects/sixthsense/

Wednesday, May 19, 2010

Aesthetic Testing




These are some experiments testing the way the RGB LEDS emit line through ping pong balls

MORE CODE!!!!!

Here is some more uselful code that we are using in this project. The codes takes the values from the Accelerometer and outputs the values using the RGB LEDS

const int groundpin = 18; // analog input pin 4 -- ground
const int powerpin = 19; // analog input pin 5 -- voltage
const int xpin = 2; // x-axis of the accelerometer
const int ypin = 1; // y-axis
const int zpin = 0; // z-axis (only on 3-axis models)
const int blueLed = 9; // output pin for blue LED
const int redLed = 10; // output pin for red LED
const int greenLed = 11; // output pin for green LED
void setup()
{


pinMode(groundpin, OUTPUT);
pinMode(powerpin, OUTPUT);
digitalWrite(groundpin, LOW);
digitalWrite(powerpin, HIGH);

//sets pins for LEDs as outputs
pinMode(blueLed, OUTPUT);
pinMode(redLed, OUTPUT);
pinMode(greenLed, OUTPUT);
}
void loop()
{
//run tilitToLight function for each axis
tiltToLight(xpin, blueLed);
tiltToLight(ypin, redLed);
tiltToLight(zpin, greenLed);

}

void tiltToLight(int readFrom, int writeTo){

int readVal = (analogRead(readFrom) - 400);

//check for out-of-range values
if (readVal < 0) {
readVal = 0;
}
else if(readVal > 255) {
readVal = 255;
}


analogWrite(writeTo, (readVal));

}

Monday, May 17, 2010

ACCELEROMETER/RGB LED INITIAL TEST VID

Testing





Today we purchased a couple of RGB leds for testing with the accelerometer that Anne lent out to us while we wait for our multi pack of RGB Leds and Arduino Lillypad Accelerometer to arrive. I have found a useful piece of code that takes the values from the accelerometer and maps them into the RGB Leds.

#define AVARAGE_READINGS 10

int Rled = 9;
int Gled = 10;
int Bled = 11;
int Xpin = 0;
int Ypin = 1;
int Zpin = 2;

void setup()
{
Serial.begin(9600);

pinMode(Rled, OUTPUT);
pinMode(Gled, OUTPUT);
pinMode(Bled, OUTPUT);
}

void loop()
{
int x = analogRead(Xpin);
int y = analogRead(Ypin);
int z = analogRead(Zpin);
for (byte i=0; i
x += analogRead(Xpin);
x /= 2;
y += analogRead(Ypin);
y /= 2;
z += analogRead(Zpin);
z /= 2;
}


x = map(x, 268, 405, 0, 255);
y = map(y, 270, 420, 0, 255);
z = map(z, 354, 450, 0, 255);

Serial.print("X ");
Serial.print(x);
Serial.print(" Y ");
Serial.print(y);
Serial.print(" Z");
Serial.println(z);

analogWrite(Rled, x);
analogWrite(Gled, y);
analogWrite(Bled, z);
}

Sunday, May 16, 2010

NEW SENSOR


We found out that the temperature sensor was not sensitive enough to produce a wide range of values. So from here we have decided to use an Arduino Lillypad accelerometer that we will import.

Thursday, May 13, 2010

Coding!!!!



I have been experimenting with the temperature sensor in order to find out whether or not it will be sensitive enough to reflect the body's change in state. Ie whether or not the body temperature will vary enough to use the information accurately in our project

Ideas for visual aesthetic



These are some initial sketches for what the output could look like, very rough initial ideas

Monday, May 10, 2010

Aesthetic Inspiration






The aesthetic component of our project will be reflective of and aztec style necklace/ broach piece of jewellery. The design will consists of different segments that will light up when different moods are present in the body. The lights will all turn on when the user is in a particular state, also i vibrating sensor will be incorporated to alert the user when they are in a stressful state or environment.

Project 3 Final Idea



For project three our group has decided to go ahead and use a temperature sensor and RGB LEDs to create a Mood necklace taking inspiration from the mood rings. The different states of the body will reflect the mood and the color of the RGB LEDs.


Monday, May 3, 2010

project 3 idea!!!


My idea for project three is to incorporate a temperature sensor and a series of LEDs to demonstrate whether or not the user is in a relaxed state of mind, or whether they are hot, flustered, embarrassed, uptight, nervous etc . The idea is that the temperature sensor maybe fitted into the garment around the armpit area because that area of the body would record temperature information about the body reasonably accurately. The output would be a series of LEDs that would be arranged accordingly around the body and depending on the temperature of the user would depend on the color of the LEDs and also the brightness. The ideal solution is that the colors of the LEDs would illuminate the entire garment. So the communication of body language is clear and understood.