loading
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.  

Step 1: Materials

List

-Arduino

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

-Nine Volt (optional)

-Nine volt adapter (optional)

-USB cable

Step 2: Power Methods

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

Step 3: LED

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

Step 4: 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);
}               

Step 5: Video

this is my video
for making the code a LOT more simple you can use loops which would reduce your loop() function down to about 10-15 lines of code rather than like 50, and also why are you waiting 50,000,000 milliseconds at the end?
THX i am new to this and i wanted to loop it but i didn't know how to end the loop so i did a long pause at the end so i can hit the button "striking" the match

About This Instructable

4,305views

5favorites

License:

Bio: I am interested in computer programming and robotics engineering. I am a true nerd.
More by D5quar3:Java Rock, Paper, Scissors Colorful USB Flash Drive Case Arduino LED Matchstick 
Add instructable to: