Challenge Name | Running Man |
Author | Kyle Chan |
Credit | I referenced the code off newinnovstors.com |
Difficulty Level (1-5) | 3. |
Time To Complete | 5 minutes |
Challenge Hint | |
Description | The four LEDs blink in different orders |
Answer |
int ledPin2 = 3;
int ledPin3 = 4;
int ledPin4 = 5;
void setup ()
{
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
}
void loop()
{
{
int delayTime = 100;
int delayTime1 = 200;
digitalWrite(ledPin1, HIGH);
delay(delayTime1);
digitalWrite(ledPin4, HIGH);
delay(delayTime1);
digitalWrite(ledPin3, HIGH);
delay(delayTime1);
digitalWrite(ledPin2, HIGH);
delay(delayTime1);
digitalWrite(ledPin1, LOW);
delay(delayTime1);
digitalWrite(ledPin4, LOW);
delay(delayTime1);
digitalWrite(ledPin3, LOW);
delay(delayTime1);
digitalWrite(ledPin2, LOW);
delay(delayTime1);
}
}
|
Wednesday, 25 November 2015
Challenge 2 - Multi LEDs
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment