Working Procedure
setup() and loop() are two fundamental Arduino functions for controlling the behavior of your board. The Arduino framework automatically calls these functions, which form the foundation of any Arduino program.
The setup() function is only called once when the Arduino board boots up or is reset. Its goal is to set pin modes, initialize variables, and execute any other necessary setup tasks before the main loop begins. This function can be used to configure settings that should only be changed once over the board’s lifespan.
The loop()
function is the heart of an Arduino program. After the setup()
function is executed, the loop()
function starts running repeatedly until the Arduino is powered off or reset. It contains the main code that performs the desired tasks, controls the board, user input. Whatever is included in the loop()
function will be executed in a continuous loop, allowing the Arduino to perform its intended functions continuously.
In the code, we have declared two integers, LEDpin and delayT. LEDpin represents the pin number of the Arduino where LEDs need to be connected, and delayT is an integer variable for the delay() function. The delay() function accepts values in milliseconds.
LED Blinking Using Arduino
We will interface an LED (light-emitting diode) to the Arduino UNO board. An LED is a simple diode that emits light in a forward bias. We will write an LED-blinking program on the Arduino IDE and download it to the microcontroller board. The program simply turns ON and OFF LED with some delay between them.
Table of Content
- Blinking an LED
- Working procedure
- Components Required
- Arduino Code
- Deployment Using Arduino IDE
- Circuit Diagram
- Applications