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
}
Monday, May 31, 2010
Sunday, May 30, 2010
acrylic aesthetic
Monday, May 24, 2010
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
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));
}
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
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
Thursday, May 13, 2010
Coding!!!!
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
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.
Subscribe to:
Comments (Atom)


