Arduino LED Matchstick

by D5quar3 in Circuits > Arduino

4753 Views, 6 Favorites, 0 Comments

Arduino LED Matchstick

P1020618.JPG
I saw https://www.instructables.com/id/Fire-free-LED-Matchstick/, but to my dismay it was only a video. So i had my Arduino and i thought I could do the same thing as it.  

Materials

P1020620.JPG
List

-Arduino

-LED (if you have a onboard LED connected to pin thirteen, optional)

-Nine Volt (optional)

-Nine volt adapter (optional)

-USB cable

Power Methods

P1020623.JPG
P1020622.JPG
There are two ways to power the Arduino, USB or DC port. For this you can just use the USB Port

LED

P1020624.JPG
If you decide to use a external led put the positive end in pin thirteen and the negative lead to ground.

The Code

int ledPin = 13; // LED connected to digital pin 13
// The setup() method runs once, when the sketch starts
void setup() {
// initialize the digital pin as an output:
pinMode(ledPin, OUTPUT);
}

// the loop() method runs over and over again,
// as long as the Arduino has power

void loop()
{
digitalWrite(ledPin, HIGH);
delay(4000);
digitalWrite(ledPin, HIGH);
delay(30);
digitalWrite(ledPin, LOW);
delay(30);
digitalWrite(ledPin, HIGH);
delay(30);
digitalWrite(ledPin, LOW);
delay(30);
digitalWrite(ledPin, HIGH);
delay(35);
digitalWrite(ledPin, LOW);
delay(35);
digitalWrite(ledPin, HIGH);
delay(35);
digitalWrite(ledPin, LOW);
delay(35);
digitalWrite(ledPin, HIGH);
delay(35);
digitalWrite(ledPin, LOW);
delay(35);
digitalWrite(ledPin, HIGH);
delay(35);
digitalWrite(ledPin, LOW);
delay(35);
digitalWrite(ledPin, HIGH);
delay(35);
digitalWrite(ledPin, LOW);
delay(35);
digitalWrite(ledPin, HIGH);
delay(35);
digitalWrite(ledPin, LOW);
delay(35);
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(45);
digitalWrite(ledPin, HIGH);
delay(45);
digitalWrite(ledPin, LOW);
delay(45);
digitalWrite(ledPin, HIGH);
delay(45);
digitalWrite(ledPin, LOW);
delay(45);
digitalWrite(ledPin, HIGH);
delay(45);
digitalWrite(ledPin, LOW);
delay(45);
digitalWrite(ledPin, HIGH);
delay(45);
digitalWrite(ledPin, LOW);
delay(50);
digitalWrite(ledPin, HIGH);
delay(500);
digitalWrite(ledPin, HIGH);
delay(55);
digitalWrite(ledPin, LOW);
delay(55);
digitalWrite(ledPin, HIGH);
delay(55);
digitalWrite(ledPin, LOW);
delay(55);
digitalWrite(ledPin, LOW);
delay(50000000);
}               

Video

this is my video

Downloads