Monday, 30 November 2015

Arduino Challenge 1: LED Blinking (Make Your Own Challenge)

Challenge NameLED Bilnking
AuthorChristina He
Credit-New Innovators: Lab 1
Difficulty Level (1-5)Level 2 
Time To CompleteApproximately 15 minutes
Challenge DescriptionMake one LED to blink on low power for two times, wait for 3 seconds, and blink on high power for one time. The LED will blink continuously.
HintEvery second is 1000 for delay function
Answer
Code:

int ledPin = 13; 

void setup() 

  pinMode(ledPin, OUTPUT); 
}

void loop() 
{
  digitalWrite(ledPin, LOW);
  delay(1000);
  digitalWrite(ledPin, LOW);
  delay(3000);
  digitalWrite(ledPin, HIGH);
  delay(1000);

}

Photos:

























No comments:

Post a Comment