You are on page 1of 5

Rondolo, Elison C.

December 4, 2020

ECE 3B Engr. Elvin Magdaong

ECE 8 - ELECTRONICS 3

ACTIVITY 6: LABORATORY EXERCISE 2

Flowchart

Introduction

In this activity, flow chart is used to represent the process needed to formulate a code that
will make the desired output. A flowchart can also be defined as a diagrammatic representation of
an algorithm, a step-by-step approach to solving a task. A flowchart is simply a graphical
representation of steps. It shows steps in sequential order and is widely used in presenting the
flow of algorithms, workflow or processes. Typically, a flowchart shows the steps as boxes of
various kinds, and their order by connecting them with arrows.

Using a flowchart has a variety of benefits:

 It helps to clarify complex processes.


 It identifies steps that do not add value to the internal or external customer, including delays;
needless storage and transportation; unnecessary work, duplication, and added expense;
breakdowns in communication.
 It helps team members gain a shared understanding of the process and use this knowledge to
collect data, identify problems, focus discussions, and identify resources.
 It serves as a basis for designing new processes.

Objective

 To understand the concept of creating an organized flowchart.


 To create a program based on flow chart.
 To be able construct a flowchart that will make the LED blink with a delay of 1 second.

Materials

 Laptop/Computer
 Microsoft Word Application
Construction of a flowchart to blink an LED blink with a delay of 1 second (there are 1000
milliseconds in a second).

LOOP

setBuiltInLED
State = ON

Delay(1000)

setBuiltInLED
State = OFF

Delay(1000)

END
Data and Results

In this laboratory activity, I construct/design a flowchart that will program the Arduino’s
output high (+5V) and low output (0V), and then the LED which connected to the Arduino’s output
will blink with a delay of 1 second.

Types of flowchart blocks that I used:

Interconnector

- If a flowchart starts to become too large, then interconnectors can


be used to break the flowchart up into separate sheets or sections.

Operation Block

- This block is used to represent a peripheral method, such as


switching a light on or off or writing some text to a display.

Time Delay Block

- This block creates a time delay in the program

Code:

void setup() {

pinMode(LED_BUILTIN, OUTPUT);

void loop() {

digitalWrite(LED_BUILTIN, HIGH);

delay(1000);

digitalWrite(LED_BUILTIN, LOW);

delay(1000);

}
Key functions used in program:

setup()
The setup() function is called when a sketch starts. Use it to initialize variables, pin
modes, start using libraries, etc. The setup function will only run once, after each power up or
reset of the Arduino board.

loop()
After creating a setup()function, which initializes and sets the initial values, the loop()
function does precisely what its name suggests, and loops consecutively, allowing your
program to change and respond. Use it to actively control the Arduino board.

pinMode()
Configures the specified pin to behave either as an input or an output.
As of Arduino 1.0.1, it is possible to enable the internal pullup resistors with the mode
INPUT_PULLUP. Additionally, the INPUT mode explicitly disables the internal pullups.

digitalWrite()
Write a HIGH or a LOW value to a digital pin. If the pin has been configured as an
OUTPUT with pinMode(), its voltage will be set to the corresponding value: 5V (or 3.3V on
3.3V boards) for HIGH, 0V (ground) for LOW.
If the pin is configured as an INPUT, digitalWrite() will enable (HIGH) or disable (LOW)
the internal pullup on the input pin. It is recommended to set the pinMode() to
INPUT_PULLUP to enable the internal pull-up resistor.

delay()
Pauses the program for the amount of time (in miliseconds) specified as parameter.
(There are 1000 milliseconds in a second.)
Observation

In this laboratory activity, I construct a flowchart that will program the Arduino’s output high
(+5V) and low output (0V), and then the LED which connected to the Arduino’s output will blink
with a delay of 1 second.

Circuit Diagram/Simulation

As shown in the schematic diagram above, the anode of LED is connected to Arduino’s
output via a resistor, and the cathode of LED is connected to the ground (GND). When the
Arduino’s output is high level, the LED is on; when the Arduino’s output is low level, the LED is off.

For example, we select Arduino's D5 pin to control the LED. When the Arduino’s D5 pin is
programmed to output high level, then the LED will be ON, next delay for 1 second, and then
programmed the D5 pin to low level to make the LED OFF. Continue to perform the above
process, you can get a blinking LED with a delay of 1 second.

You might also like