You are on page 1of 1

DEPARTMENT OF COMPUTER SCIENCE & ENGG.

BHILAI INSTITUTE OF TECHNOLOGY, DURG (C.G.)


DIGITAL ELECTRONICS LAB MANNUAL
EXPERIMENT 6

Aim: To program blinking of two LED simultaneously using Arduino.

Objective: To learn the basic concepts of digital electronics using Arduino.

Component Required:
1. Arduino
2. bread board
3. 2 resistors
4. 2 Led
5. Connecting wire
Procedure:
Step 1. Connect the Arduino to raspberry pi using USB port
Step 2. Connect key board and mouse to raspberry pi.
Step 3. Connect monitor to raspberry pi using HDMI cable.
Step 4. Connect two resistors using wire in bread board to pin 3 and 6 of Arduino
Step 5. Connect other end of each resistor with anode (long leg) of each Led in bread board
Step 6. Connect the cathode of each Led using wire in bread board with GND pin of Arduino

Code
void setup()
// put your setup code here, to run once:
{
pinMode (3, OUTPUT); // initialize digital pin 3 as an output.
pinMode (6, OUTPUT); // initialize digital pin 6 as an output.
}

void loop()
// put your main code here, to run repeatedly:
{
digitalWrite (3, HIGH); // turn the LED1 on (HIGH is the voltage level)
digitalWrite (6, LOW); // turn the LED2 off by making the voltage LOW
delay (1000); // Wait for 1000 millisecond(s)
digitalWrite (3, LOW); // turn the LED1 off by making the voltage LOW
digitalWrite (6, HIGH); // turn the LED2 on (HIGH is the voltage level)
delay (1000); // Wait for 1000 millisecond(s)
}

Result: ………………………………………………………………………………………………

Precautions:
1. Prepare the circuit before switching on the power supply.
2. Circuit to be checked before switching on the power supply.

Shiv Dutta Mishra, Assistant Professor (C.S.E.). Bhilai Institute of Technology, Durg (C.G.)

You might also like