Assignment 6.1

Post date: Aug 16, 2010 12:1:4 AM

int potPin = 2;

int val = 0;

void setup()

{

}

void loop()

{

for (int led = 13; led >=5; led--)

{

val = analogRead(potPin);

pinMode(led, OUTPUT);

digitalWrite(led, HIGH);

delay(val);

digitalWrite(led, LOW);

delay(val);

}

for (int led = 5; led <=13; led++)

{

val = analogRead(potPin);

pinMode(led, OUTPUT);

digitalWrite(led, HIGH);

delay(val);

digitalWrite(led, LOW);

delay(val);

}

}