COMPTECH 315 BIT III B Module 01 LED DISPLAY Part 3

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Republic of the Philippines

CEBU TECHNOLOGICAL UNIVERSITY


NAGA EXTENSION CAMPUS
Central Poblacion, City of Naga, Cebu, Philippines
Website: http://www.ctu.edu.ph E-mail: ctunagaextensioncampus@gmail.com
Phone: +6332 417 0418

COLLEGE OF TECHNOLOGY

MIS Code : __________ Schedule : 01:00 PM-04:00 PM MON-FRI

Course Subject : COMPTECH 315 (Microprocessor System) Room No. : Room 311

Curriculum : BIT-COMPTECH Instructor : AL D. HORTEZA, LPT, Ph.D.

Semester : 1st Semester Academic Year : AY 2023-2024

MODULE 01
LED DISPLAY – PART 3

LEARNING OBJECTIVES:
 To construct a microprocessor/microcontroller circuit using Arduino Uno with resistors and light-
emitting diodes (LEDs) as output components.
 To program a microprocessor/microcontroller circuit based on the required output. In this module, the
required output is to light the LEDs in the following manner:
 Left-To-Right, then OFF
 Right-To-Left, then OFF
 Both Sides-To-Center, then OFF
 Center-To-Both Sides, then CYCLE

LIST OF COMPONENTS:

Item No. Item Description Quantity


1 Breadboard 1 pc
2 Arduino UNO R3 1 pc
3 330 ohms 1/4W Resistor 8 pcs
4 Light-Emitting Diodes (LEDs) 8 pcs
5 AWG #22 Solid Wire

CIRCUIT DIAGRAM:
Republic of the Philippines
CEBU TECHNOLOGICAL UNIVERSITY
NAGA EXTENSION CAMPUS
Central Poblacion, City of Naga, Cebu, Philippines
Website: http://www.ctu.edu.ph E-mail: ctunagaextensioncampus@gmail.com
Phone: +6332 417 0418

COLLEGE OF TECHNOLOGY

SOURCE CODE:
}
int i,temp;
int displayLED1[8]={2, 3, 4, 5, 6, 7, 8, 9}; for(i=0;i<8;i++)
int displayLED2[8]={2, 3, 4, 5, 6, 7, 8, 9};; digitalWrite(displayLED1[i], LOW);
int displayLED3[8]={2, 3, 4, 5, 6, 7, 8, 9};; delay(300);

void setup() { temp = 7;


for(i=0;i<8;i++) //i++ --> i = i + 1 --> i += 1 for(i=0;i<4;i++) {
pinMode(displayLED1[i], OUTPUT); digitalWrite(displayLED2[i], HIGH);
} digitalWrite(displayLED3[temp], HIGH);
delay(300);
void loop() { digitalWrite(displayLED2[i], LOW);
digitalWrite(displayLED3[temp], LOW);
for(i=0;i<8;i++) temp--;
digitalWrite(displayLED1[i], LOW); }
delay(300);
for(i=0;i<8;i++)
for(i=0;i<8;i++) { digitalWrite(displayLED1[i], LOW);
digitalWrite(displayLED1[i], HIGH); delay(300);
delay(300);
digitalWrite(displayLED1[i], LOW); temp = 4;
} for(i=3;i>=0;i--) {
digitalWrite(displayLED2[i], HIGH);
for(i=0;i<8;i++) digitalWrite(displayLED3[temp], HIGH);
digitalWrite(displayLED1[i], LOW); delay(300);
delay(300); digitalWrite(displayLED2[i], LOW);
digitalWrite(displayLED3[temp], LOW);
for(i=7;i>=0;i--) { temp++;
digitalWrite(displayLED1[i], HIGH); }
delay(300); }
digitalWrite(displayLED1[i], LOW);
Republic of the Philippines
CEBU TECHNOLOGICAL UNIVERSITY
NAGA EXTENSION CAMPUS
Central Poblacion, City of Naga, Cebu, Philippines
Website: http://www.ctu.edu.ph E-mail: ctunagaextensioncampus@gmail.com
Phone: +6332 417 0418

COLLEGE OF TECHNOLOGY

Prepared and Submitted By:

TYPE YOUR COMPLETE NAME HERE (Example: ADAM JOHN M. HORTEZA)


BIT III-B Student, College of Technology
CTU-Naga Extension Campus
Central Poblacion, City of Naga, Cebu 6037 Philippines
As of First Semester, AY 2023-2024

Submitted To:

AL D. HORTEZA, LPT, Ph.D.


Associate Professor V, College of Technology
CTU-Naga Extension Campus
Central Poblacion, City of Naga, Cebu 6037 Philippines
As of First Semester, AY 2023-2024

Date Submitted : ____________________

Date Checked : ____________________

You might also like