Task 19:
int LEDPin = 13;
int delvar; //This variable changes the speed of the LEDPin2 LED.
void setup()
{
pinMode(LEDPin, OUTPUT);
}
void loop()
{
for (int count = 1; count < 11; count++)
{
delvar = (count * 100);
digitalWrite(LEDPin, HIGH);
delay(delvar);
digitalWrite(LEDPin, LOW);
delay(delvar);
}
}
Task 20:
int LEDPin = 13;
int delvar; //This variable changes the speed of the LEDPin2 LED.
void setup()
{
pinMode(LEDPin, OUTPUT);
}
void loop()
{
for (int count = 1; count < 101; count++)
{
delvar = (count * 10);
digitalWrite(LEDPin, HIGH);
delay(delvar);
digitalWrite(LEDPin, LOW);
delay(delvar);
}
for (int count = 100; count > 0; count--)
{
delvar = (count * 10);
digitalWrite(LEDPin, HIGH);
delay(delvar);
digitalWrite(LEDPin, LOW);
delay(delvar);
}
}
Thursday, April 29, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment