Arduino LED Matchstick
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
List
-Arduino
-LED (if you have a onboard LED connected to pin thirteen, optional)
-Nine Volt (optional)
-Nine volt adapter (optional)
-USB cable
-Arduino
-LED (if you have a onboard LED connected to pin thirteen, optional)
-Nine Volt (optional)
-Nine volt adapter (optional)
-USB cable
Power Methods
There are two ways to power the Arduino, USB or DC port. For this you can just use the USB Port
LED
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);
}
// 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