Description:
For this assignment I was extremely inspired by this art peice:https://vimeo.com/76479685
I have attempted to recreate the concept behind the functioning of the peice which is,
a circuit in delicate balance which gets excited by external input and then undergoes damped oscillations for a delayed effect.
I placed the light sensor near the led and found out the balance condition for the circuit to go into recursion additionally the light sensor is connected to the speaker, so now whenever external light comes in, the circuit goes into recursion producing a twinkling sound and light.
I am trying to produce the damped oscillations but somehow it's not perfect yet...
Items Used:
2 Led's
1 Light Sensor
1 Arduino
3 Resistors
Code Used:
/*
* I262 - Assingment 5
* ---------------
* Function : Circuit goes into recursion once excited by external input
* Date : 10.15.2013
* Author : Suhaib Saqib Syed
*/
int potPin = 0;
int speakerPin = 7;
int led = 6;
int led2 = 11;
int val = 0;
void setup() {
pinMode(speakerPin, OUTPUT);
Serial.begin(9600);
Serial.println("ready");
}
void loop() {
digitalWrite(speakerPin, LOW);
val = analogRead(potPin);
if(val >= 100 ){
for (int j = 0; j < 6 ; j = j++ ){
analogWrite(led2, (60 - j*10)); // Feedback for recursion
for( int i=0; i<100; i++ ) { // play it for 50 cycles
analogWrite(led, 1000);
digitalWrite(speakerPin, HIGH);
delayMicroseconds(300);
analogWrite(led, 0);
digitalWrite(speakerPin, LOW);
delayMicroseconds(200);
}
delay(300);
Serial.print("J = ");
Serial.println(j);
val = val - val*0.4; // for the delayed fade effect
Serial.println(val);
}
};
}
- Login to post comments