9.3k views
4 votes
To run blink, we need short leg in ______
and long leg in _______

1 Answer

3 votes

Answer:

To run blink, we need short leg in GND pin and long leg in digital pin 13

Step-by-step explanation:

The blink program in the Arduino is used to test the built-in LED of the Arduino boards or an external LED may also be used.

The long leg of the external LED is the anode terminal which is connected to the digital pin 13 via 220 ohm resistor in order to limit the current.

The short leg of the external LED is the cathode terminal which is connected to the ground pin (GND).

Following functions are used in the blink program,

First we select the pin as an output where we have connected the external LED that is pin 13

pinMode(LED_BUILTIN, OUTPUT);

Please note that LED_BUILTIN refers to the pin 13 for most of the Arduino boards. If you want to use any other digital pin then you have to write the pin number in the place of LED_BUILTIN.

Then in the main loop section we turn on the LED by providing HIGH command.

digitalWrite(LED_BUILTIN, HIGH);

Then we may provide some delay

delay(1000)

Then we turn off the LED by providing LOW command.

digitalWrite(LED_BUILTIN, LOW);

The program will turn on the LED for 1 second then it will turn off the LED for 1 second and it will keep on repeating.

User Ramzy
by
5.5k points