Header Ads

Arduino tutorial for beginners basic program to turn Led ON and OF #02

 Arduino tutorial for beginners basic program to turn Led ON and OF #02


How to connect led to an arduino uno ?
For more details watch below video:


Required Component:

1. led

2. jumper cable

3. Arduino uno board

4. Bread board

5. 100 ohm - 1k register


LED:

A Drove (Light Radiating Diode) is a little electronic part that produces light when an electric flow goes through it. LEDs are ordinarily utilized in different applications, like lighting, markers, and showcases.

Jumper wries:

A jumper link, otherwise called a jumper wire or jumper lead, is a short wire with connectors at the two closures used to make brief electrical associations. It is regularly utilized in prototyping and circuit testing to interface various focuses on a breadboard or electronic parts.

Arduino Uno Board:

The Arduino Uno board is a famous microcontroller board in view of the Atmel ATmega328P microcontroller. It gives a stage to building and programming electronic undertakings. The Arduino Uno board is broadly utilized for its effortlessness, adaptability, and broad local area support.

Breadboard:

A breadboard, otherwise called a prototyping board or solderless breadboard, is a device used to fabricate and test electronic circuits without the requirement for fastening. It comprises of a matrix of openings that permit parts and wires to be effortlessly embedded and associated, working with quick prototyping.

100 ohm - 1k Resistor:

A resistor is an electrical part that restricts the progression of electric flow in a circuit. The 100 ohm - 1k resistor has an obstruction esteem going from 100 ohms to 1 kilohm (1,000 ohms). It is regularly used to control current stream, change voltage levels, and give circuit security in different electronic ventures


Do the connection as shown in below :




Write program as below:


void setup()

{

  pinMode(12, Result);

}

void loop()

{

  digitalWrite(12, 1); // you can take HIGH also

  delay(500);

  digitalWrite(12, 0);//you can take LOW also

  delay(500);

}

The given code is written in the Arduino programming language, which depends on C/C++. Here is a clarification of the code:


void  setup()

{

  pinMode(12, Result);

}


In the 'setup()' capability, the 'pinMode()' capability is utilized to set pin 12 as a result. This implies that pin 12 will be utilized to control an outer gadget.



void loop()

{

  digitalWrite(12, 1);

  delay(500);

  digitalWrite(12, 0);

  delay(500);

}


The 'loop()' capability is characterized to control the condition of pin 12. It sets pin 12 to a rationale HIGH state utilizing 'digitalWrite()', which turns on the outer gadget associated with pin 12. It then presents a postponement of 500 milliseconds utilizing 'delay()'.

After the deferral, it sets pin 12 to a rationale LOW state utilizing 'digitalWrite()', which switches off the outer gadget. It presents one more deferral of 500 milliseconds prior to rehashing the cycle.

The reason for this code is to make a flickering impact on the outside gadget associated with pin 12. It turns the gadget on for 500 milliseconds, switches it off for 500 milliseconds, and rehashes this cycle endlessly.

Note: The 'void loop()' capability is absent in the given code. The 'loop()' capability is ordinarily utilized in Arduino projects to more than once characterize the principal code that runs. Without the 'loop()' capability, the program won't execute any further directions subsequent to finishing the 'arrangement()' capability.



Thanks 
info@infysky.com

No comments

Blinking TWO Led's with Arduino and Breadboard #03

Blinking TWO Led's with Arduino and Breadboard In this tutorial we will see how to turn on two Led's using Arduino Uno for beginn...

Powered by Blogger.