You are on page 1of 2

COMPUTER ENGINEERING DEPARTMENT

First Semester AY 2022-2023

CPE 122 – PROGRAMMING LOGIC AND DESIGN


Midterm Examination

Name: _______________________________________ Date: ____________ Score: __________


Course/Year/Section: __________________________ Instructor: Blessed Joy O. Aramay

I. Instruction: Create an Arduino program that consistently executes the following


conditions. Save the code file with an '.ino' extension and proceed to upload it to the
designated Google Drive folder shared by the Instructor.

Pin for Right LED: __________


Pin for Left LED: ___________
Pins for SW1 – SW4: ________
Delay: ________

Condition 1 If switch no. 1 is high, Arduino performs pattern no. 1


Condition 2 If switch no. 2 is high, Arduino performs pattern no. 2
Condition 3 If switch no. 3 is high, Arduino performs pattern no. 3
Condition 4 If switch no. 4 is high, Arduino performs pattern no. 4
Condition 5 If switch no. 1 and 2 are high and switch no. 3 and 4 are low, Arduino performs pattern no. 1
Condition 6 If switch no. 1 and 2 are low and switch no. 3 and 4 are high, Arduino performs pattern no. 3
If either switch no. 1 or 2 is high and either switch 3 or 4 is low, Arduino performs either
Condition 7 pattern no. 1 or pattern no. 2
If either switch no. 1 or 2 is low and either switch 3 or 4 is high, Arduino performs either
Condition 8 pattern no. 1 or pattern no. 2

Pattern Output
10101010
Pattern 1
10101010
11110000
Pattern 2
11110000
11001100
Pattern 3
11001100
10101010
10101010
11110000
Pattern 4
11110000
11001100
11001100

Page 1 of 2
RUBRICS
Condition 10 7 5 0
The task The task performed The task performed
Program is not
Condition No. 1 performed with 1-3 error with more than 3
working
without error founds errors
The task The task performed The task performed
Program is not
Condition No. 2 performed with 1-3 error with more than 3
working
without error founds errors
The task The task performed The task performed
Program is not
Condition No. 3 performed with 1-3 error with more than 3
working
without error founds errors
The task The task performed The task performed
Program is not
Condition No. 4 performed with 1-3 error with more than 3
working
without error founds errors
The task The task performed The task performed
Program is not
Condition No. 5 performed with 1-3 error with more than 3
working
without error founds errors
The task The task performed The task performed
Program is not
Condition No. 6 performed with 1-3 error with more than 3
working
without error founds errors
The task The task performed The task performed
Program is not
Condition No. 7 performed with 1-3 error with more than 3
working
without error founds errors
The task The task performed The task performed
Program is not
Condition No. 8 performed with 1-3 error with more than 3
working
without error founds errors

Prepared by:

BLESSED JOY O. ARAMAY


Instructor 1, CPE 122

Reviewed by:

DIONISIO M. MARTIN JR., PCPE


Program Chair, BSCpE

Approved by:

MARLON JAMES A. DEDICATORIA, RMEE, Ph.D.


Dean, College of Engineering

Page 2 of 2

You might also like