You are on page 1of 8

Colegio De San Juan De Letran - Calamba

Calamba City, Laguna

School of Engineering

MICRO 131L: Microprocessor Systems Lab

Programming Basic I/O in Arduino MCU Board


Laboratory Experiment No. 6

Grade

Group Number
Group Leader
Members

: _________
: SN, FN MI
: SN, FN MI

Signature
_______________________
_______________________

SN, FN MI

_______________________

Date Performed: ________________


Date Submitted: ________________

Engr. Ricrey E. Marquez, CpE, MSCS


(Lab Instructor)

OBJECTIVES AND MATERIALS


Objectives:
1. To be familiar with Arduino board pin configurations and its functions.
2. To understand the how Arduino send and receive data from the output device.
3. To design and create an Arduino basic IO programs that are optimize as possible.
Materials:
Quantity
1
1
1
1 set

Part Number
-

Description
Universal MCU Trainer Kit
Gizduino Board
USB cable
Connecting wires

PROCEDURES
1. Consider the design application stated below, construct an Arduino-based IO circuit in
Universal Microcontroller Trainer Kit for each applications. Draw and label each schematic
diagram.
2. Create and test basic IO Arduino sketch programs by uploading the firmware to the
Gizduino MCU board (locally available Arduino-compatible board) connected to the IO
circuit made in step 1.
3. Optimize your codes and avoid magic numbers. Observe the outputs and write the
program code in data results.
Design Application No. 1 - 4 Alternate four LEDs
Create an Arduino Sketch program that lit LED sequence shown below for
20 times. Hint: Use looping statement for the number of iterations. (Filenames:
DesignApps1.ino, DesignApps1.h)

Figure 6.1. LED sequence of design application 1


Design Application No. 2 4-Bit Down-Count BCD Counter.
Create an Arduino Sketch program and test a 4-bit down-count similar to
the figure below. (Filenames: DesignApps2.ino, DesignApps2.h)

Figure 6.2 LED sequence of design application 2

Design Application No. 3 - Close-open LEDs


Create an Arduino Sketch that will lit LEDS shown below. Hint. Use array
variables for the LED patterns. (Filenames: DesignApps3.ino, DesignApps3.h)

Figure 6.3. LED sequence of design application 3


Design Application No. 4 Bi-directional 2-bit Shift Operation
Shifting two LEDs at a time from left to right. Hint: To have an optimize code, use
shift operators instead of using arrays for LED patterns. (Filenames: DesignApps4.ino,
DesignApps4.h)

Figure 6.4. LED sequence of design application 4


Design Application No. 5 Seven Segment Sequence with Control Switch
Create an Arduino Sketch that will read push button switch, then will display
sequence of seven-segment display shown in the table below. Hint: Use array variable for
seven-segment display and temporary counter variable for push button pulse.
(Filenames: DesignApps5.ino, DesignApps5.h)

NO. OF PULSE
0
1
2
3
Other

SEVEN-SEGMENT SEQUENCE
0 1 2 3 4 5 6 7 8 9 0, then repeat
1 3 5 7 9, then repeat
9 8 7 6 5 4 3 2 1 - 0, then repeat
0 2 4 6 8, then repeat
Set pulse 0

SCHEMATIC DIAGRAM

Figure 6.1. Schematic diagram for design applications 1 to 4.

Figure 6.2. Schematic diagram for design application 5.

DATA RESULTS

Program Listing 1 Code for design application 1

Program Listing 2 Code for design application 2

Program Listing 3 Code for design application 3

Program Listing 4 Code for design application 4

Program Listing 5 Code for design application 5

GROUP CONCLUSION

You might also like