FINAL: Feather Skirt- Betty Quinn/ Birce Ozkan/ Jagrat Desai

_dsc0074

First iteration that I came up with  for major studio:

The feather skirt is a smart and fashionable piece, which features the technology of a navigational instrument.

This augmented skirt gives the user an additional layer of sensing that allows her to find the direction by imitating nature. The garment appropriates the migration method of birds; these are known as being excellent navigators; they have built-in biological compasses to tell them which way to fly based on detecting variations in the earth’s magnetic field.

photo 35

The skirt has embedded electronics that include a microcontroller, servo motors and an electronic compass that measures earth’s magnetic field; this last component is adjusted to detect north. If the wearer walks towards the correct cardinal direction, an array of feathers connected to the 2-servo motors rise, else the feathers go down and stop moving.  The piece serves as a metaphor, which highlights a method of appropriation where the human nature is enhanced through the process of bio-mimicry.

10301186_2931651981510_6502755299091712453_n (1)

For the digital self, Betty,Jagrat and I decided to control the movement of feathers with using Nuerosky Mindwave. The speed and height of the top layer of feathers are determined by the attention level.The Processing Code:

import processing.serial.*;
import cc.arduino.*;
import processing.net.*;

Arduino arduino;

//TCP connection to thinkgear
Client gear;
//TCP buffer
byte[] byteBuffer = new byte[1024];

int signal = 200; //start 200
int attention = 0; //start 0
int attentionMapped;

//Setup and load all resources
void setup() {
size(360, 200);
frameRate(24);
//Client connection to thinkgear tcp port 13854
gear = new Client(this,”127.0.0.1″,13854);
//Send configuration JSON to thinkgear
String configure = “{\”format\”:\”Json\”,\”enableRawOutput\”:false}”;
gear.write(configure);

//Create Thinkgear connection thread.
Runnable runnable = new MindwaveReader();
Thread thread = new Thread(runnable);

// Prints out the available serial ports.
println(Arduino.list());

// Modify this line, by changing the “0” to the index of the serial
// port corresponding to your Arduino board (as it appears in the list
// printed by the line above).
arduino = new Arduino(this, Arduino.list()[10], 57600);

// Alternatively, use the name of the serial port corresponding to your
// Arduino (in double-quotes), as in the following line.
//arduino = new Arduino(this, “/dev/tty.usbmodem621″, 57600);

// Configure digital pins 4 and 7 to control servo motors.
//arduino.pinMode(4, Arduino.SERVO);
arduino.pinMode(9, Arduino.SERVO);

thread.start();
}
//Get poorSignalLevel from JSON
//Ugly but works.
int getSignal(String myString) {
int index = -1;
String signal = “”;
//Find if this string contains poorSignalLevel
index = myString.indexOf(“poorSignalLevel”);
if(index != -1) {
index = myString.indexOf(“\”:”,index);
index = index+2;
//Ugly but works for this test.
for(int i=0;i<3;i++) {
char c = myString.charAt(index+i);
if(c > 47 && c < 58) {
signal += c;
}
}
//little debug
//println(“Signal: “+signal);
} else return -1;
return int(signal);
}
//Same as above but with attention
int getAttention(String myString) {
int index = -1;
String signal = “”;
index = myString.indexOf(“attention”);
if(index != -1) {
index = myString.indexOf(“\”:”,index);
index = index+2;
for(int i=0;i<3;i++) {
char c = myString.charAt(index+i);
if(c > 47 && c < 58) {
signal += c;
}
}
println(“Attention: “+signal);
} else return -1;
return int(signal);
}
//Runnable for reading mindwave values from thinkgear.
class MindwaveReader implements Runnable {

public void run() {
while(true) {
if (gear.available() > 0) {
int byteCount = gear.readBytes(byteBuffer);
if (byteCount > 0 ) {
// Convert the byte array to a String
String myString = new String(byteBuffer);
//Check signal level
int si = getSignal(myString);
int at = getAttention(myString);
//Only set globals if value found in JSON
if(si != -1) {
signal = si;
}
if(at != -1) {
attention = at;
}
}
}
}
}
}
void draw() {
background(constrain(mouseX / 2, 0, 180));

// Write an value to the servos, telling them to go to the corresponding
// angle (for standard servos) or move at a particular speed (continuous
// rotation servos).

attentionMapped = (int)map(attention, 0, 500, 0, 15);
println(“attention mapped is: ” + attentionMapped);
for (int pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
{
// in steps of 1 degree
arduino.servoWrite(9, pos); // tell servo to go to position in variable ‘pos’
delay(8 – attentionMapped); // waits 15ms for the servo to reach the position
}
delay(8 – attentionMapped); // waits 15ms for the servo to reach the position

for(int pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
delay(8 – attentionMapped); // waits 15ms for the servo to reach the position

arduino.servoWrite(9, pos); // tell servo to go to position in variable ‘pos’
// delay(20 – attentionMapped); // waits 15ms for the servo to reach the position
}

// arduino.servoWrite(7, constrain(mouseX / 2, 0, 180));
//arduino.servoWrite(4, constrain(180 – mouseX / 2, 0, 180));
}

/*
for int i, 0 180{
arduino write (7, i, 0, 180)
delay(
}
*/

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>