Project 2 – Project Runway

So for the second project I had this fantastic idea to create a DDR like game using fingers. Essentially, the user would put on a pair of gloves, that would have sensors in the finger tips and five LEDs running down each finger to the tip. The LEDs would light up, in a “chasing light” pattern and indicate what the next finger to tap would be. Well after attempting to solder the LEDs and resisters together and attaching it to a glove, it did not look very good. So in light of what we were able to accomplish, it has been decided that we would continue with the project and finish it, but some serious changes would have to be made, regarding where the LEDs will be. We were able to attach a button sensor to a row of LEDs and when pressed will reset the lights.

:: CODE ::
/*
* Blink
*
* The basic Arduino example. Turns on an LED on for one second,
* then off for one second, and so on… We use pin 13 because,
* depending on your Arduino board, it has either a built-in LED
* or a built-in resistor so that you need only an LED.
*
* http://www.arduino.cc/en/Tutorial/Blink
*/

void setup() // run once, when the sketch starts
{
Serial.begin(9600); // use the serial port to send the values back to the computer
}

int myPins[] = {1,2,3,4,5,8,9,10,11,12,13}; // LED connected to digital pin 13
//int potPin = 8; // select the input pin for the potentiometer
int val = 0; // variable to store the value coming from the sensor

void loop() // run over and over again
{
// val = digitalRead(potPin); // read the value from the sensor
// Serial.println(val); // print the value to the serial port
// if(val == 1)
// {
for(int i=0; i<10; i++)
{
pinMode(myPins[i], OUTPUT); // sets the digital pin as output
digitalWrite(myPins[i], HIGH); // sets the LED on
delay(100); // waits for a second
// val = digitalRead(potPin);
// if(val==0) {
// break;
}
// }
// // }
// if(val== 0)
// {
for(int i=0; i<10; i++)
{
pinMode(myPins[i], OUTPUT); // sets the digital pin as output
digitalWrite(myPins[i], LOW); // sets the LED off
}
// }
}

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.