Introduction: LED Blinking
step one: build the circuit
step two: write the code
//Blinking_LED
//turn on the LED for half a second, then off for half a second, repeatedly
const int ledPin = 9;//the number of the LED pin
void setup()
{
pinMode(ledPin,OUTPUT);//initialize the digital pin as an output
}
void loop()
{
digitalWrite(ledPin,HIGH);//turn the LED on
delay(700); // delay 0.7 seconds
digitalWrite(ledPin,LOW); //turn the LED off
delay(700); //delay 0.7 seconds
}
/*************************************************/
step three: upload the board
then the LED light will blink!!!
((you can add a case for your work to make it prettier))
Supplies
- Arduino board * 1
- USB cable * 1
- Resistor * 1
- LED * 1
- Breadboard * 1
- Jumper wires