![]() ![]() “digitalWrite(led_pin, LOW) ” makes the voltage on the GPIO pin 3 to 0V. “digitalWrite(led_pin, HIGH) ” makes the led_pin as HIGH means provides 5V at GPIO pin 3. Such as the pin name to which the LED is connected and the state of the pin. ![]() In this function, we have called a function “ digitalWrite() ” in this function, we pass two arguments. Void loop() : This function executes infinitely in our program. In this function, we are passing the “led_pin” as pin name and “OUTPUT” as type. The pinMode function is used to tell Arduino, that the connected peripheral is either input or output peripheral. In this function, we have called a function called “ pinMode(led_pin, OUTPUT) ”. Void setup() : This function executes only once in our program. We are assigning GPIO 3 pin of Arduino to connect LED and given a name to that pin as “led_pin”. ![]() #define led_pin 3 : First, we have declared a pin name and pin number to which we are going to connect the LED using #define preprocessor constant. Below is the code for blinking LED using Arduino. Once, the Arduino IDE is installed on your PC, we have to write a code to blink an LED in the interval of one second. You can download and install Arduino IDE suitable for your computer OS from For programming our Arduino to blink an LED, we need Arduino IDE to be installed on our PC. Make the connections as per the circuit diagram shown in the above image. In this blog, we will blink an LED using Arduino. LED stands for Light-emitting diode. An LED is a device that produces light whenever current is passed through it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |