Explination of the project here
One of the oldest symbols of vanity still in use is the mirror. Snow White is a classic tale with a mirror that only tells the truth so we took that concept and turned it up a little bit. People put a lot of time and money to look. The first to condemn you in the morning or evening before you leave home is often yourself when you make the final touches in front of the mirror. So what happens if you are not the one who gives the opinion, but a real “mean machine”? We wanted to get people to think about all the time and money you put on their “image” really been worth it. To be pulled down to earth is a very humbling feeling that many people should experience more often.
We use arduino and proximity sensor to accomplish this project. The idea is that a person is in front of the mirror for an X amounth of time the mirror will insult that person.
You will need Arduino to control the proximity sensor and processing to control the audio.
Source CODE arduinofungerarnu:
/* * Pablo Suzarte * Fina project "Mean Machines" * Physicial Prototyping * Interaction Design * Malmö University * contact me: pablosu@gmail.com */ int sensorPin = 0; // Analog input pin int sensorValue = 0; // value read from the sensor int check = 0; long previousMillis = 0; long interval = 5000; void setup() { randomSeed(42); Serial.begin(9600); // for debugging } void loop() { unsigned long currentMillis = millis(); sensorValue = analogRead(sensorPin); // read the sensor value //Serial.println(sensorValue); // the sensor actually gives results that aren't linear. // this formula converts the results to a linear range. int range = (6787 / (sensorValue )); if( range >10 && range<90 && check == 0) { delay(200); sensorValue = analogRead(sensorPin); // read the sensor value int range = (6787 / (sensorValue )); if( range >10 && range<90){ previousMillis = currentMillis; check = 1; Serial.print('1'); delay(5000); } } else if( range >10 && range<90 && check == 1 && (currentMillis - previousMillis > interval)) { previousMillis = currentMillis; check = 2; Serial.print('2'); delay(10000); } else if( range >10 && range<90 && check == 2 && (currentMillis - previousMillis > interval)) { previousMillis = currentMillis; check = 0; Serial.print('3'); delay(6000); } else if((range <10 && range > 0)|| range>90) check = 0; //Serial.println('3'); //Serial.println(range); delay(200); //Serial.println(range, DEC); // print the sensor value //delay(1000); }
import ddf.minim.*; import ddf.minim.signals.*; import ddf.minim.analysis.*; import ddf.minim.effects.*; import cc.arduino.*; long start, finished, elapsed; //variable for the timer int counter, total; int desireTime = 1; int desireTime2 = 5; boolean check = false; Minim minim; AudioPlayer song; AudioPlayer song2; AudioPlayer s0; AudioPlayer s1; AudioPlayer s2; AudioPlayer s3; AudioPlayer s4; int index = int (random(0, 2)); int beginTime = 0; // Example by Tom Igoe import processing.serial.*; Serial myPort; // The serial port PFont myFont; // The display font String inString; // Input string from serial port char i; int lf = 10; // ASCII linefeed void setup() { size(400, 200); minim = new Minim(this); s0 = minim.loadFile("damn.mp3"); s1 = minim.loadFile ("now.mp3"); s2 = minim.loadFile ("per.mp3"); // s1= minim.loadFile ("cheer.mp3"); // s2= minim.loadFile ("littleblackman.mp3"); // s3 = minim.loadFile ("ParkBusFace.mp3"); // s4 = minim.loadFile ("ratface.mp3"); // Make your own font. It's fun! // myFont = loadFont("AgencyFB-Reg-48.vlw"); // textFont(myFont, 18); // List all the available serial ports: println(Serial.list()); // I know that the first port in the serial list on my mac // is always my Keyspan adaptor, so I open Serial.list()[0]. // Open whatever port is the one you're using. myPort = new Serial(this, "COM6", 9600); myPort.buffer(3); } void draw() { if ( myPort.available() > -1) { // If data is available, i = myPort.readChar(); // read it and store it in val myPort.clear(); } background(255); println(i); if (i == '1' ) { timer(); } // if (beginTime>0&& millis()-beginTime> 500){ //if (inString!= null) //i = Float.valueOf(inString).floatValue(); if (i == '2') { // delay(3000); timer2(); // check = false; } if (i == '3'){ timer3(); } // else if(i<20 && i>90){ // check = false; // } } /*void serialEvent(Serial myPort) { inString = myPort.readString(); println("värde"+inString); }*/ void stop() { song.close(); minim.stop(); super.stop(); } void timer() { //start=millis(); // delay(3000); counter++; // if (counter>=desireTime && song.isPlaying() == false) { // for (int i=0;i<10;i++) { // // s[index].play(); // delay(9500); // song.pause(); // song.rewind(); // //SKRATT s0.play(); delay(8100); s0.pause(); s0.rewind(); delay(2000); } void timer2() { counter++; // if (counter>=desireTime2 && song.isPlaying() == false) { //CHEER s1.play(); delay(6000); s1.pause(); s1.rewind(); delay(5000); // //BUSFACE // s3.play(); // delay(2500); // s3.pause(); // s3.rewind(); // delay (3000); } void timer3(){ counter++; //Littleman s2.play(); delay(9100); s2.pause(); s2.rewind(); }
Final Product:
Video!