Love-0-matic spaceship (Analog switch, PhysComp week2)
The spaceship idea came from a piece of scrap wood that I found today at the shop. A potentiometer creates the “love” that powers the LED lights although my original idea was to use a FSR (all the cool sensors were sold out at the NYU book store). Another idea was to use a IR sensor so the user could power the LED lights with the proximity of a body part. There is song by Kool Keith called “super galactic lover” that also was part of my inspiration. 
Enough about the ifs. The love-0-matic spaceship was design to be powered by the “love” being created inside of it by the crew on board. The basic idea presented today is that the potentiometer triggers each LED light according to the range given inside the “if” statement.
At first I used four LEDs to get a feel for the creative project. After that was accomplished I generated code for the graph effect with the help from Kate.
I used the ITP shop to create the design for the spaceship. 
I ended up using six LED lights that range from green (not too much love) to red (light speed).
That’s the ship at full potential. cool huh?
When the potentiometer is turned half way, cruising speed, which means that people are taking a cigarette break from all the love making.
Well that’s it. Oh here is the code:
int potPin = 0; // Analog input 1
int potPin2 = 1; // Analgo input 2
int potValue = 0; // value read from sensor 1
int potValue2 = 0; //value read from sensor 2
int ledone = 3; // led 1
int ledtwo = 5; // led 2
int ledthree = 6; //led 3
int ledfour = 9; //led 4
int ledfive = 10; //led 5
int ledsix = 11; //led6
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
void loop() {
potValue = analogRead(potPin);
if (potValue > 1 && potValue < 169){
analogWrite(ledone, 255);
analogWrite(ledtwo, 0);
analogWrite(ledthree, 0);
analogWrite(ledfour, 0);
analogWrite(ledfive, 0);
analogWrite(ledsix, 0);
analogWrite(ledone, potValue);
}
else if (potValue > 169 && potValue < 339) {
//analogWrite(ledone, 255);
analogWrite(ledthree, 0);
analogWrite(ledtwo, potValue/6);
}
else if (potValue > 339 && potValue < 509) {
analogWrite(ledone, 255);
analogWrite(ledtwo, 255);
analogWrite(ledfour, 0);
analogWrite(ledthree, potValue/6);
}
else if (potValue > 509 && potValue < 679) {
analogWrite(ledthree, 255);
analogWrite(ledfive, 0);
analogWrite(ledfour, potValue/6);
}
else if (potValue > 679 && potValue < 849) {
analogWrite(ledfour, 255);
analogWrite(ledsix, 0);
analogWrite(ledfive, potValue/6);
}
else if (potValue > 849) {
analogWrite(ledfive, 255);
analogWrite(ledsix, potValue/6);
}
if (potValue == 0) {
analogWrite(ledone, 0);
analogWrite(ledtwo, 0);
analogWrite(ledthree, 0);
analogWrite(ledfour, 0);
analogWrite(ledfive, 0);
analogWrite(ledsix, 0);
}
Serial.println(potValue); // print the pot value back to the debugger pane
delay(20);
}
