Lesson-1: Arduino Led Burning Led Extinguishing (Blink)
Arduino Led Burning Led Extinguishing (Blink)
LECTURE VIDEO:
CIRCUIT DIAGRAM:
Necessary materials:
1 Arduino Uno Card
1pc red Led
1pc 330 ohm resistance
Cabling
The short leg of the Led should be attached to the GND pin on the Arduino Card. 330 ohm resistor is connected so that the Led is not damaged. The long leg of the LED is attached to pine number 7 on the Arduino card. You can attach it to other pins. You must specify these pin numbers in the codes.
Codes Of The Circuit
void setup()
{
pinMode(7, OUTPUT);
}
void loop()
{
digitalWrite(7, HIGH);
delay(1000); // Wait for 1000 millisecond(s)
digitalWrite(7, LOW);
delay(1000); // Wait for 1000 millisecond(s)
}
We attached Led’s long leg to Cartin’s PIN number 7. in the void setup section, pinMode (7, OUTPUT); we need to specify this with the command. Otherwise, this pin will not be active.
The Void loop section is the section where the program’s codes are constantly repeated and run. With digitalWrite(7, HIGH) command, we give pine 5V number 7 and the Led is on. delay (1000); command line holds for 1 sec. Then with digitalWrite(7, LOW); 5V cut.
Thus, we have designed an led that flashes at intervals of 1 er seconds. if you make the time 500, the led will make it faster (half a second) and turn off.