EMD6M1A
EM220
April 2019
INTRODUCTION
This session will start off with simple experiment which is blinking LED repeatedly. Firstly,
the circuit is assembled with LED, wires, and 220 Ohm Resistor. Then, the program will be
uploaded to tell Arduino what to do.
OBJECTIVES
To imitate how traffic lights, blink repeatedly. The system is portrayed by 3 LED which, each
LED possess specific delay time.
EXPERIMENTAL PROCEDURE
Coding
2
Flowchart
Start
Wait 0.5s No
Wait 0.5s
Wait 1s No
Wait 1s
Wait 2s No
Wait 2s
3
Figure shows the circuit setup
DISCUSSION
This is one of the fundamental Arduino examples where the built-in system has default of
turning 13 pin LED on and off with a second interval within. However, for improvisation, 3
LED are used instead of 1 LED to observe alternate blinking. The yellow, red, and green LED
are plugged at pin 8, 9, and 10 respectively. The declaration is placed in void setup( ) function
by pinMode(LEDPIN, OUTPUT) which means the declared LED will carry out everything
propose to them. In void loop( ), the instructions are given by digitalWrite(LEDPIN, HIGH).
This command specify what the LED will do either on or off by HIGH or LOW. HIGH means
high voltage will pass through thus turn the pin on and the other way for LOW. ON and OFF
can also being used besides HIGH and LOW. Next, delay time of the 3 LED can also be
manipulated in sequence. Delay time system used in Arduino is millisecond i.e. “delay(1000)”
where the microcontroller will delay the voltage for 1 second. The blinking will forever be in
loop unless the circuit is open. At this point of the code, it can be comprehended that an
instruction in software makes something happen in the physical world by controlling the flow
of electricity to the pin.