How do you make an LED light blink with Arduino?

2 years ago
5

LEDs are small, powerful lights that are used in many different applications. To start, we will work on blinking an LED, the Hello World of microcontrollers. It is as simple as turning a light on and off. Establishing this important baseline will give you a solid foundation as we work towards experiments that are more complex.

Components Required
You will need the following components −

1 × Breadboard
1 × Arduino Uno R3
1 × LED
1 × 330Ω Resistor
2 × Jumper

Sketch
Open the Arduino IDE software on your computer. Coding in the Arduino language will control your circuit. Open the new sketch File by clicking New.

Code to Note
pinMode(2, OUTPUT) − Before you can use one of Arduino’s pins, you need to tell Arduino Uno R3 whether it is an INPUT or OUTPUT. We use a built-in “function” called pinMode() to do this.

digitalWrite(2, HIGH) − When you are using a pin as an OUTPUT, you can command it to be HIGH (output 5 volts), or LOW (output 0 volts).
mmmmmmResult
You should see your LED turn on and off. If the required output is not seen, make sure you have assembled the circuit correctly, and verified and uploaded the code to your board.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------mFHTAMM

Loading comments...