// Project 38
#define sensorPin 9
int ledPin1 = 1;
int ledPin2 = 2;
int ledPin3 = 3;
int ledPin4 = 4;
int ledPin5 = 5;
int ledPin6 = 6;
int ledPin7 = 7;
int ledPin8 = 8;
int ledPin10 = 10;
int ledPin11 = 11;
int ledPin12 = 12;
int ledPin13 = 13;
//float ledValue = 255; // The brightness of the LED
long pwmRange, inch;
void setup() {
// Start serial communications
Serial.begin(9600);
pinMode(sensorPin, INPUT);
pinMode(ledPin1, OUTPUT); // Set the ledPin to an OUTPUT
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
pinMode(ledPin4, OUTPUT);
pinMode(ledPin5, OUTPUT);
pinMode(ledPin6, OUTPUT);
pinMode(ledPin7, OUTPUT);
pinMode(ledPin8, OUTPUT);
pinMode(ledPin10, OUTPUT);
pinMode(ledPin11, OUTPUT);
pinMode(ledPin12, OUTPUT);
pinMode(ledPin13, OUTPUT);
// Flash the LED twice to show the program has started
digitalWrite(ledPin1, HIGH);
delay(150);
digitalWrite(ledPin1, LOW);
delay(150);
digitalWrite(ledPin2, HIGH);
delay(150);
digitalWrite(ledPin2, LOW);
delay(150);
digitalWrite(ledPin3, HIGH);
delay(150);
digitalWrite(ledPin3, LOW);
delay(150);
digitalWrite(ledPin4, HIGH);
delay(150);
digitalWrite(ledPin4, LOW);
delay(150);
digitalWrite(ledPin5, HIGH);
delay(150);
digitalWrite(ledPin5, LOW);
delay(150);
digitalWrite(ledPin6, HIGH);
delay(150);
digitalWrite(ledPin6, LOW);
delay(150);
digitalWrite(ledPin7, HIGH);
delay(150);
digitalWrite(ledPin7, LOW);
delay(150);
digitalWrite(ledPin8, HIGH);
delay(150);
digitalWrite(ledPin8, LOW);
delay(150);
digitalWrite(ledPin10, HIGH);
delay(150);
digitalWrite(ledPin10, LOW);
delay(150);
digitalWrite(ledPin11, HIGH);
delay(150);
digitalWrite(ledPin11, LOW);
delay(150);
digitalWrite(ledPin12, HIGH);
delay(150);
digitalWrite(ledPin12, LOW);
delay(150);
digitalWrite(ledPin13, HIGH);
delay(150);
digitalWrite(ledPin13, LOW);
delay(150);
/* digitalWrite(ledPin11, HIGH);
delay(150);
digitalWrite(ledPin11, LOW);
delay(150);
digitalWrite(ledPin12, HIGH);
delay(150);
digitalWrite(ledPin12, LOW);
delay(150);
digitalWrite(ledPin12, HIGH);
delay(150);
digitalWrite(ledPin12, LOW);
delay(150);
*/
}
void loop() {
//analogWrite(ledPin, int(ledValue) ); // Write brightness value to LED
pwmRange = pulseIn(sensorPin, HIGH);
// 147uS per inch according to datasheet
inch = pwmRange / 147;
Serial.println(pwmRange);
delay(175);
// if (ledValue <= 0) {
// ledValue = 0;
//} // Make sure value does not go below zero
// ledValue = ((5*(inch))-25);
//}
if ((pwmRange <= 2019) && (pwmRange >= 288)) {
digitalWrite(ledPin1, HIGH );
}
else if ((pwmRange <= 3217) && (pwmRange >= 2020)) {
digitalWrite(ledPin2, HIGH );
}
else if ((pwmRange <= 4415) && (pwmRange >= 3218)) {
digitalWrite(ledPin3, HIGH );
}
else if ((pwmRange <= 5613) && (pwmRange >= 4416)) {
digitalWrite(ledPin4, HIGH );
}
else if ((pwmRange <= 6811) && (pwmRange >= 5614)) {
digitalWrite(ledPin5, HIGH );
}
else if ((pwmRange <= 8009) && (pwmRange >= 6812)) {
digitalWrite(ledPin6, HIGH );
}
else if ((pwmRange <= 9207) && (pwmRange >= 8010)) {
digitalWrite(ledPin7, HIGH );
}
else if ((pwmRange <= 10405) && (pwmRange >= 9208)) {
digitalWrite(ledPin8, HIGH );
}
else if ((pwmRange <= 11603) && (pwmRange >= 10406)) {
digitalWrite(ledPin10, HIGH );
}
else if ((pwmRange <= 12801) && (pwmRange >= 11604)) {
digitalWrite(ledPin11, HIGH );
}
else if ((pwmRange <= 13999) && (pwmRange >= 12802)) {
digitalWrite(ledPin12, HIGH );
}
else if ((pwmRange <= 15198) && (pwmRange >= 14000)) {
digitalWrite(ledPin13, HIGH );
}
else {
digitalWrite(ledPin1, LOW);
digitalWrite(ledPin2, LOW);
digitalWrite(ledPin3, LOW);
digitalWrite(ledPin4, LOW);
digitalWrite(ledPin5, LOW);
digitalWrite(ledPin6, LOW);
digitalWrite(ledPin7, LOW);
digitalWrite(ledPin8, LOW);
digitalWrite(ledPin10, LOW);
digitalWrite(ledPin11, LOW);
digitalWrite(ledPin12, LOW);
digitalWrite(ledPin13, LOW);
}
}
Here is process of my project working during Critique in the dark. My model for this project is Jason. While he was wearing the brain, he had a sensory deprivation experience, which I thought was interesting.
Here is the video:
ps. the light is not the best, but you can kind of see the form of Jason with the brain on his head and the lights working.
Reflection: I had a lot of fun with this piece, despite the minor setbacks. The first issue that I had was not receiving the microphone that would work with my project until the day of critique itself (go figure). But I worked through that and created another analogy for the idea of connections and being close to another person to gain understanding. Also, it was brought to my attention that I needed more LEDs and in other areas of the brain, which I agree with. In a possible addition to this piece, I could use an arduino mega so that I could have more pins to put LEDs in. One of the critiques that I found most interesting is the idea of sensory deprivation in many categories. I might like to explore this a little bit more. One thing I thought would be really interesting is when someone mentioned making a brain that restricts your sight and then creating a room where they could not be hurt and all they could do is hear and touch. Another interesting deprivation room would be to only allow seeing within the space. I agree that the lights needed to be placed in different areas of the brain and had forgotten or gotten stuck on the idea of the body being cognizant of speech rather than touch and distance. Ultimately, I would like to expand on this project, possibly in my last semester as installation or advanced experiments.
No comments:
Post a Comment