LIGHT UP LED USING ARDUINO UNO

To light up an led we just need a DC power source and ground terminal here we connect led anode terminal (+) to pin number 13 (digital IO) so that if we program our code as pin number 13 as HIGH (+5V), it behaves as power source and Cathode terminal (–) of led to the ground terminal of Arduino so that the circuit will get complete.

After uploading the program to Arduino, if we give power to Arduino Uno then it will light up the LED.

Required hardware or components for Lighting up LED using Arduino

S.N.ComponentQuantity
1.Arduino Uno1
2.Breadboard1
3.LED1
4.Resistor 220 or 280 ohm1

CIRCUIT DIAGRAM

Light up led using arduino circuit diagram
Click to zoom
S.N.ArduinoLED
1.13Anode (+)
2.GNDCathode (-)

ARDUINO CODE: LIGHT UP LED USING ARDUINO UNO

void setup() {
  pinMode(13, OUTPUT);
}
void loop() {
  digitalWrite(13, HIGH);
}

CODE EXPLANATION

Step-1: In the setup function we decide the mode of digital pins either as INPUT or OUTPUT. Let’s concentrates on output for now.
Function pinMode( )” is used to define the pin working mode as an input/output.
In this function we have to pass two argument – 

  1. First one is pin number and
  2. Second is its mode, pinmode(pinNumber, mode)

In this we set pin number 13 as output: pinmode(13, OUTPUT).

void setup() {
  pinMode(13, OUTPUT);
}

Step-2: In the loop function we are using one inbuilt function that is digitalWrite( ).
Function “digitalWrite( )” is used to instruct the controller/Arduino to set the state of a particular digital pin as either LOW or HIGH.
In digitalWrite( ) function we also pass two argument – 

  1. First one is pin number and
  2. Second is its state, digitalWrite(pinNumber, state).

In this we set pin number 13 output as HIGH: digitalWrite(13, HIGH).

void loop() {
  digitalWrite(13, HIGH);
}

And the loop gets executed continuously and the LED remains HIGH all the time.


READ NEXT
LED BLINKING USING ARDUINO UNO


 

4 2 votes
Article Rating
Subscribe
Notify of
guest
45 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
tien len mien nam truc tuyen
tien len mien nam truc tuyen
5 years ago

95187 309356This really is a excellent common sense write-up. Quite beneficial to 1 who is just finding the resouces about this part. It will surely support educate me. 563578

12bet
12bet
5 years ago

177278 891544Theres noticeably a bundle to find out about this. I assume you made certain great points in features also. 406944

facelifts
facelifts
5 years ago

759662 107690We are a group of volunteers and opening a new system in our community. Your web web site given us with valuable information to function on. Youve done an impressive job and our entire community will be grateful to you. 456650

bong ro truc tuyen
bong ro truc tuyen
5 years ago

516080 486164An intriguing discussion is worth comment. Im certain which you basically write regarding this subject, might possibly not be considered a taboo topic but typically persons are too small to communicate on such topics. To an additional. Cheers 403630

Sooner You Realize
Sooner You Realize
5 years ago

951588 827556Your blog is one of the much better blogs Ive came across in months. Thank you for your posts and all the greatest with your function and blog. Seeking forward to reading new entries! 679252

replicas relojes
replicas relojes
5 years ago

730262 219779Spot up for this write-up, I seriously believe this web site needs a lot a lot more consideration. Ill apt to be once much more to learn additional, appreciate your that information. 601455

datasgp
datasgp
5 years ago

825107 553927Wanted posting. Loads of exceptional writing here. I wish I saw it located the website sooner. Congrats! 388663

datasgp
datasgp
5 years ago

475769 714251Hey there. I want to to inquire somethingis this a wordpress weblog as we are thinking about shifting more than to WP. Also did you make this theme on your personal? Thanks. 650644

cách chơi chắn vạn văn
cách chơi chắn vạn văn
5 years ago

326675 315259Hi, you used to write exceptional articles, but the last several posts have been kinda boring I miss your super writing. Past several posts are just a little out of track! 35282

طراحی سایت تهران
طراحی سایت تهران
5 years ago

196321 346714conclusion which you are completely proper but a few require to be 790543

45
0
Would love your thoughts, please comment.x
()
x