short description


Both artists have been working together over the last years. In the last installations they used plastic bags as the symbol of capitalism and consumer society. The main idea is to put a plastic bag in the wind like a flag of freedom. The motion of the plastic bag in the wind produces noise, which is being captured and used for further processing. Ramifications of noise go widely and, in turn, the artists are reacting to this quickly, so this installation is a live windy surprise.

img_9030.jpg
img_9031.jpg
Video

//JAKUB & BEA, OKNO WINDCLOCKS
//firmware for arduino with netshield
float servogo = 0;
int ledPin1 = 2;
int ledPin2 = 5;
int ledPin3 = 7;
int ledPin4 = 3;
int servoPin = 6;
//piezo analog 0,1,2,3

float actuals[4];
int actualAread = 0;
float avg = 0;
float smoothAvg = 0;
float lastAvg = 0;
//long lastTik = 0;

boolean ramp;
boolean oldramp;

int windspeed = 0;
#include <Servo.h> 
Servo myservo;


#include <SPI.h>
#include <Ethernet.h>

//Network setup, you should adapt this of course
byte mac[] ={ 0xFA, 0xAD, 0xB0, 0x9F, 0xA9, 0x1E}; // has to be an unique one so change this
byte ip[] = {192,168,200,67}; // has to be an unique one so change this
byte gateway[] = {192,168,200,1}; // check this with balt@okno.be
byte subnet[] = {255, 255, 255, 0 }; 
int port = 30223;
byte server[] = {62,58,108,215}; // tik.okno.be


// initialize the library instance:
//Client client(server, 30223);
EthernetClient client;

//clock and tik JSON strings
//updated for the new TAK server, 20120501
//50.855058,4.341954
String clock = String("{\"name\":\"fogs_of_the_morning\",\"longitude\":\"50.855058\",\"latitude\":\"4.341954\",\"altitude\":\"0.0\",\"metaDataDefinitions\":[{\"name\":\"windspeed\",\"type\":\"int\"}]}\n");

String sting(float sila){
  String tik = String("{\"metaDataValues\":[{\"name\":\"windspeed\",\"type\":\"int\",\"value\":") + 
              String((int)sila) + String("}]}\n");
  return tik;
}

float smoother(float stab, int go, int amount){
  return stab + (go - stab) / amount;    
}

void ledoff(){
	digitalWrite(2, LOW);
	digitalWrite(3, LOW);
	digitalWrite(5, LOW);
	digitalWrite(7, LOW);
}

boolean doesItTik(){  
	avg = 0;
	for(int i = 0; i < 4; i++){
		actualAread = analogRead(i);
		if(actualAread > actuals[i]){
			ledoff();
			switch (i){
				case 0:
					digitalWrite(ledPin1, HIGH);
					break;
				case 1:
					digitalWrite(ledPin2, HIGH);
					break;
				case 2:
					digitalWrite(ledPin3, HIGH);
					break;
				case 3:
					digitalWrite(ledPin4, HIGH);
					break;
			}
		}
		actuals[i] = smoother(actuals[i], actualAread, 100);
        avg+=actuals[i];
	}

        //Serial.println(avg);
        
	//lastTik = millis();
	
	//return (millis() - lastTik) > (int)70000/avg;
        smoothAvg = smoother(smoothAvg, avg, 100);
        //Serial.println(smoothAvg);
        ramp = (smoothAvg - lastAvg) > 0;
        lastAvg = smoothAvg;
        if(ramp != oldramp){
          
          oldramp = ramp;
          return true;
        }
        else{return false;}          


/*
        if(abs(smoothAvg - lastAvg)>2){
          lastAvg = smoothAvg;
          //oldramp = ramp;
          return true;
        }
        else{return false;}*/
        
}

///////////////////////////////////////////
//////////////////////////////////////////

void setup(){
	Serial.begin(9600);
        pinMode(ledPin1, OUTPUT);
        pinMode(ledPin2, OUTPUT);
        pinMode(ledPin3, OUTPUT);
        pinMode(ledPin4, OUTPUT);
	myservo.attach(servoPin);
	   
	Ethernet.begin(mac); 
	//Ethernet.begin(mac, ip, gateway, subnet); 
	delay(1000); // give ethernet shield time to boot
	Serial.println(clock);
	//make the connection
	client.connect(server, port); 

	if(client.connected()){
		Serial.println("connected!"); 
		client.print(clock); //first connection sends clockId to register with the TAK server
	}
}

void loop(){


  
if(client.connected()){
  if(doesItTik()){ 
 
    String tik = String("{\"metaDataValues\":[{\"name\":\"windspeed\",\"type\":\"int\",\"value\":") + 
                String((int)smoothAvg) + String("}]}\n");
  
    Serial.println(tik);
    client.print(tik);     
    

  } 
  
}

  //wait 5 seconds and reconnect
  else
  {
    Serial.println("no connection");
    delay(5000);
    client.stop();
    client.connect(server, port);
    client.print(clock);
  }
servogo = 175-2*(int)avg;
if(servogo>0){
  myservo.write(servogo);
}
else{
myservo.write(0);
}
 // Serial.println(175-(int)smoothAvg);
      delay(10);
  
  
}


 
a_plastic_bag_by_jakub_pisek_and_beata_kolbasovska.txt · Last modified: 2012/05/28 11:50 by kubriel
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki