Documentation Booklet part 3

21

description

 

Transcript of Documentation Booklet part 3

Page 1: Documentation Booklet part 3

Using Arduino

Page 2: Documentation Booklet part 3

Using Arduino For more details please visit: http://panagiotiskalpenos.tumblr.com/

Page 3: Documentation Booklet part 3

Using Arduino For more details please visit: http://panagiotiskalpenos.tumblr.com/

Arduino Code for “Peter” in morse Code

int led = 13;

void setup(){ pinMode(led, OUTPUT);

}void loop(){digitaldigitalWrite(led, HIGH);delay(500); digitalWrite(led, LOW);delay(500); digitalWrite(led, HIGH);delay(1500); digitalWrite(led, LOW);delay(500); delay(500); digitalWrite(led, HIGH);delay(1500); digitalWrite(led, LOW);delay(500); digitalWrite(led, HIGH);delay(500);

digitaldigitalWrite(led, LOW);delay(1500);

digitalWrite(led, HIGH);delay(500);

digitalWrite(led, LOW);delay(1500);

digitalWrite(led, HIGH);delay(1500); delay(1500);

digitalWrite(led, LOW);delay(1500);

digitalWrite(led, HIGH);delay(500);

digitalWrite(led, LOW);delay(1500);

digitaldigitalWrite(led, HIGH);delay(500); digitalWrite(led, LOW);delay(500); digitalWrite(led, HIGH);delay(1500); digitalWrite(led, LOW);delay(500); delay(500); digitalWrite(led, HIGH);delay(500);

}

Page 4: Documentation Booklet part 3

Using Arduino For more details please visit: http://panagiotiskalpenos.tumblr.com/

Research on various Interactive Projects

Page 5: Documentation Booklet part 3

Using Arduino For more details please visit: http://panagiotiskalpenos.tumblr.com/

Research on various Interactive Projects

Senseable City LabNOX Architecture

Page 6: Documentation Booklet part 3

Using Arduino For more details please visit: http://panagiotiskalpenos.tumblr.com/

Using potentiometer, light sensor, LED lights and motor servo in Arduino.

int firstSensor = 0; int secondSensor = 0; int thirdSensor = 0; int inByte = 0; void setup(){ Serial.begin(9600); Serial.begin(9600); pinMode(2, INPUT); establishContact(); }

void loop(){ if (Serial.available() > 0) { inByte = Serial.read(); inByte = Serial.read(); firstSensor = analogRead(0)/4; delay(10); secondSensor = analogRead(1)/4; thirdSensor = 100 + (155 * digitalRead(2)); Serial.write(firstSensor); Serial.write(secondSensor); Serial.write(secondSensor); Serial.write(thirdSensor); }}void establishContact() { while (Serial.available() <= 0) { Serial.write('A'); delay(300); delay(300); }}

Serial Call Response --Processing Code

import processing.serial.*;

int bgcolor; int fgcolor; Serial myPort; int[] serialInArray = new int[3]; int serialCount = 0; int xpos, ypos;int xpos, ypos; boolean firstContact = false; void setup() { size(256, 256); noStroke(); xpos = width/2; ypos = height/2;println(Serial.list());println(Serial.list());String portName = Serial.list()[0]; myPort = new Serial(this, portName, 9600);}void draw() { background(bgcolor); fill(fgcolor); ellipse(xpos, ypos, 20, 20); ellipse(xpos, ypos, 20, 20);}void serialEvent(Serial myPort) { int inByte = myPort.read(); if (firstContact == false) { if (inByte == 'A') { myPort.clear(); myPort.clear(); firstContact = true; myPort.write('A'); } } else { serialInArray[serialCount] = inByte; serialCount++; serialCount++;if (serialCount > 2 ) { xpos = serialInArray[0]; ypos = serialInArray[1]; fgcolor = serialInArray[2];

println(xpos + "\t" + ypos + "\t" + fgcolor); myPort.write('A'); serialCount = 0; serialCount = 0; } }}

Serial Call Response -- Arduino Code

Page 7: Documentation Booklet part 3

Using Arduino For more details please visit: http://panagiotiskalpenos.tumblr.com/

Flying coffee cupExperimenting with the light sensor in Arduino.

Page 8: Documentation Booklet part 3

Tangible Time

Page 9: Documentation Booklet part 3

Tangible Time - Project Development

Concept sketches exploring different ideas for the installation.

Page 10: Documentation Booklet part 3

Tangible Time - Project Development

The aim during the research was to create an interactive installation whichwould visualise time in a personal, subjective way and not through numbers ..

Page 11: Documentation Booklet part 3

Tangible Time - Project Development

Initial installation concept sketch

Page 12: Documentation Booklet part 3

Tangible Time - Project Development

Symbolic images of experiences, occasions, states, in which we “sense” time passing in our everyday lives.

Page 13: Documentation Booklet part 3

Tangible Time - Project Development

Prototype development

Page 14: Documentation Booklet part 3

Tangible Time - Project Development

Prototype development

Page 15: Documentation Booklet part 3

Tangible Time - Project Development

Page 16: Documentation Booklet part 3

Tangible Time - Final Installation

Page 17: Documentation Booklet part 3

Tangible Time - Processing Code

import processing.serial.*;

Serial myPort; // Create object from Serial classint val;

final int NumStars = 1500;PImage a;PImage b;PImage c;PImage c;PImage d;PImage e;PImage f;PImage g;PImage h;PImage i;PImage j;PImage j;PImage k;PImage l;PImage m;PImage n;PImage o;PImage p;PImage q;PImage q;float pos = 0;import ddf.minim.*;Minim minim;AudioPlayer player1;AudioPlayer player2;Star[] stars;PFontPFont ArialMT;void setup() { size(1370, 770); background(0); noStroke(); smooth(); colorMode(HSB); minim = new Minim(this); minim = new Minim(this); player1 = minim.loadFile("1.mp3"); player2 = minim.loadFile("2.mp3"); frameRate(21); String[] fontList = PFont.list(); println (fontList); ArialMT = createFont ("FFScala", 32); a = loadImage ("1.png"); a = loadImage ("1.png"); b = loadImage ("2.png"); c = loadImage ("3.png"); d = loadImage ("4.png"); e = loadImage ("5.png"); f = loadImage ("6.png"); g = loadImage ("7.png"); h = loadImage ("8.png"); h = loadImage ("8.png"); i = loadImage ("9.png"); j = loadImage ("10.png"); k = loadImage ("11.png"); l = loadImage ("12.png"); m = loadImage ("13.png"); n = loadImage ("14.png"); o = loadImage ("15.png"); o = loadImage ("15.png"); p = loadImage ("16.png"); q = loadImage ("17.png"); stars = new Star[NumStars];

for (int index = 0; index < NumStars; index++) { stars[index] = new Star(); }

String portName = Serial.list()[0]; myPort = new Serial(this, portName, 9600);}void draw() { if ( myPort.available() > 0) { // If data is available, val = myPort.read(); // read it and store it in val } } background(0);for (int index = 0; index < NumStars; index++) { stars[index].update(); stars[index].display(); } frameRate(20); frameRate(20); if (pos < 1) { image(a, 535, 235, 300, 300); // pos++; } else if (pos >= 1 && pos < 2) { image(b, 535, 235, 300, 300); // pos++; // pos++; } else if (pos >= 2 && pos < 3) { image(c, 535, 235, 300, 300); // pos++; } else if (pos >= 3 && pos < 4) { image(d, 535, 235, 300, 300); image(d, 535, 235, 300, 300); // pos++; else if (pos >= 4 && pos < 5) { image(e, 535, 235, 300, 300); // pos++; } else if (pos >= 5 && pos < 6) { image(f, 535, 235, 300, 300); image(f, 535, 235, 300, 300); // pos++; } else if (pos >= 6 && pos < 7) { image(g, 535, 235, 300, 300); // pos ++; } else if (pos >= 7 && pos < 8) { else if (pos >= 7 && pos < 8) { image(h, 535, 235, 300, 300); // pos ++; } else if (pos >= 8 && pos < 9) { image(i, 535, 235, 300, 300); // pos ++; } } else if (pos >= 9 && pos < 10) { image(j, 535, 235, 300, 300); // pos ++; } else if (pos >= 10 && pos < 11) { image(k, 535, 235, 300, 300); // pos++; // pos++;

} else if (pos >= 11 && pos < 12) { image(l, 535, 235, 300, 300); // pos++; } else if (pos >= 12 && pos < 13) { image(m, 535, 235, 300, 300); image(m, 535, 235, 300, 300); // pos++; } else if (pos >= 13 && pos < 14) { image(n, 535, 235, 300, 300); // pos++; } else if (pos >= 14 && pos < 15) { else if (pos >= 14 && pos < 15) { image(o, 535, 235, 300, 300); // pos++; } else if (pos >= 15 && pos < 16) { image(p, 535, 235, 300, 300); // pos++; } } else if (pos >= 16 && pos < 17) { image(q, 535, 235, 300, 300); // pos =0; } if (val == 1) { // frameRate(2);

player2.play(); player2.play(); player1.pause(); } else { player2.pause(); player1.play(); // frameRate(21); } } if(player1.position() > player1.length()){ player1.rewind(); if(player2.position() > player2.length()){ player2.rewind(); } } }if (val == 1) { if (pos < 17) { pos += 0.05; } else pos = 0; } } else { if (pos < 17) { pos += 1; } else pos = 0; } println(val); println(val);}

Page 18: Documentation Booklet part 3

Tangible Time - Processing Code

class Star{ float x; float y; float z; float velocity; float star_size; float screen_x; float screen_x; float screen_y; float screen_diameter; float old_screen_x; float old_screen_y; Star(){ randomizePosition(true); } } void randomizePosition(boolean randomizeZ){ x = random(-width * 2, width * 2); y = random(-height * 2, height * 2); if(randomizeZ) z = random(100, 1000); else else z = 1000; velocity = 3; //random(0.5, 5); star_size = random(2, 10); } void update(){ if(val == 1) z -= velocity;

else z -= velocity * 10; z -= velocity * 10; screen_x = x / z * 100 + width/2; screen_y = y / z * 100 + height/2; screen_diameter = star_size / z * 100; if(screen_x < 0 || screen_x > width || screen_y < 0 || screen_y > if(screen_x < 0 || screen_x > width || screen_y < 0 || screen_y > height || z < 1) { randomizePosition(false); } } void display(){ void display(){ float star_color = 255 - z * 255 / 1000; fill(star_color); ellipse(screen_x, screen_y, screen_diameter, screen_diameter); }}

Page 19: Documentation Booklet part 3

Tangible Time

Final Prototype Installation

Page 20: Documentation Booklet part 3

Tangible Time

Final exhibition - Merchiston Campus Reception, 4/12/2013

Page 21: Documentation Booklet part 3

Prototyping Interactive ExperiencesDevelopment BookletPanagiotis (Peter) Kalpenos40058911Interior and Spatial Design year 32013/2014