Blinking Led use Arduino
This is our first Arduino tutorial. In this tutorial we will learn how to blink Led use Arduino UNO.
You con watch the following video or read the written tutorial below.
You con watch the following video or read the written tutorial below.
The circuit diagram is very quick simple. The Led is connected to pin 1. Here we use 100 R resistor for limit the current.
Arduino Code:
int led = 1; // Led is connected to pin 1
void setup() {
pinMode(led,OUTPUT);
}
void loop() {
digitalWrite(led,HIGH); // Led is active
delay(100); // 100 milisecond delay
digitalWrite(led,LOW); // Led is deactive
delay(100);
}
Code Explain:
First you have to define Led pin. In this case the pin number 1 on the Arduino board is Ledpin.
In the setup you have to define the Ledpin is an output.
In this loop first you have to set the Led is Active High. Here you have to set active high for 100 milisecond. And then return Low for 100 milisecond.
No comments