0% found this document useful (0 votes)
57 views4 pages

IOE1

Its note for ioe

Uploaded by

ap9619319
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views4 pages

IOE1

Its note for ioe

Uploaded by

ap9619319
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

1

IOE LAB Assignmnet-1

Aim: To implement Traffic Light pattern using Arduino.


LAB OUTCOME : LO1,LO2

Theory:
The Arduino Uno is an open-source microcontroller board based on the Microchip ATmega328P
microcontroller and developed by Arduino.cc and initially released in 2010. The board is
equipped with sets of digital and analog input/output pins that may be interfaced to various
expansion boards and other circuits.
The Arduino boards also consists of on board voltage regulator and crystal oscillator. They also
consist of USB to serial adapter using which the Arduino board can be programmed using USB
connection.

A light-emitting diode is a semiconductor light source that emits light when current flows
through it. Electrons in the semiconductor recombine with electron holes, releasing energy in the
form of photons.

NEEL PATEL B21 ROLL NO-82


42
IOE LAB Assignmnet-1

Components Required
You will need the following components −

• 1 × Breadboard
• 1 × Arduino Uno
• 3× LED (Red Green yellow)
• 1 × 100Ω Resistor
• 3 × Jumper
1. Arduino UNO 2. LED 4. Breadboard 5. Jump Wire
3. Resistor 100
ohm

Diagram:

NEEL PATEL B21 ROLL NO-82


3
IOE LAB Assignmnet-1

Code:
int GREEN = 2;
int YELLOW = 3;
int RED = 4;
int DELAY_GREEN = 5000;
int DELAY_YELLOW = 2000;
int DELAY_RED = 5000;
void setup()
{
pinMode(GREEN, OUTPUT);
pinMode(YELLOW, OUTPUT);
pinMode(RED, OUTPUT);
}
void loop()
{
green_light();
delay(DELAY_GREEN);
yellow_light();
delay(DELAY_YELLOW);
red_light();
delay(DELAY_RED);
}
void green_light()
{
digitalWrite(GREEN, HIGH);
digitalWrite(YELLOW, LOW);
digitalWrite(RED, LOW);
}
void yellow_light()
{
digitalWrite(GREEN, LOW);
digitalWrite(YELLOW, HIGH);
digitalWrite(RED, LOW);
}
void red_light()
{
digitalWrite(GREEN, LOW);
digitalWrite(YELLOW, LOW);
digitalWrite(RED, HIGH);
}

NEEL PATEL B21 ROLL NO-82


4
IOE LAB Assignmnet-1

Result:
You should see your each LED turn on and off like a Trafic Signal at some interval of time . If
the required output is not seen, make sure you have assembled the circuit correctly, and verified
and uploaded the code to your board.

CONCLUSION: Hence Learned and implemented Traffic light Pattern of led with the
help of Arduino uno board.

NEEL PATEL B21 ROLL NO-82

You might also like