« Tilt Active Sketch | Main | Club Images and Video »

Collaborative

For this project I worked with the group on the overall construction of the club, some things such as the NEON bubble tubes, were designed for implementation of the club. The level of interactivity is limited as of yet. However the way the floor was designed and the club itself is so that modifications would be achieved without great hindrance.
The code is a modification of analog control as it uses a potentiometer that senses when a considerable amount of change in light occurs.

The code:
NightClubCode.pde

int sensorPin = 0; // select the input pin for the potentiometer
int ledpin = 4; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor
int ledpin1 = 5;
int ledpin2 = 6;
int ledpin3 = 7;
int ledpin5 = 8;
int ledpin6 = 9;
int ledpin7 = 10;
int ledpin4 = 11;
int Norm = 0;
int squid = 0;
int time = 0;
void setup() {
// declare the ledPin as an OUTPUT:
pinMode(ledpin, OUTPUT);
pinMode(ledpin1, OUTPUT);
pinMode(ledpin3, OUTPUT);
pinMode(ledpin4, OUTPUT);
pinMode(ledpin5, OUTPUT);
pinMode(ledpin6, OUTPUT);
pinMode(ledpin6, OUTPUT);
pinMode(ledpin7, OUTPUT);
Norm = analogRead(sensorPin);
}
void loop() {
squid = (analogRead(sensorPin) - Norm);
if (squid * squid > 30) {
digitalWrite(ledpin4,HIGH);//speaker control
delay(2000);
digitalWrite(ledpin4,LOW);//
digitalWrite(ledpin,HIGH);//caveman
digitalWrite(ledpin1,HIGH);//relay
digitalWrite(ledpin2,HIGH);//relay
digitalWrite(ledpin3,HIGH);//relay
digitalWrite(ledpin5,HIGH);//bubbles
digitalWrite(ledpin6,HIGH);//laser
while (time < 1000) {
digitalWrite(ledpin7,HIGH);//laser
delay(random(30,200));
digitalWrite(ledpin7,LOW);
delay(random(30,200));
time = (time + 1);
}
time = 0;

}

// read the value from the sensor:

}