Professional Documents
Culture Documents
COMPTECH-315-BIT-III-B-Module-02-7-SEGMENT-DISPLAY-WITH-SLIDESWITCH-Part-3 KENIKUN
COMPTECH-315-BIT-III-B-Module-02-7-SEGMENT-DISPLAY-WITH-SLIDESWITCH-Part-3 KENIKUN
COLLEGE OF TECHNOLOGY
Course Subject : COMPTECH 315 (Microprocessor System) Room No. : Room 311
MODULE 02
7-SEGMENT DISPLAY WITH SLIDESWITCH – PART 3
LEARNING OBJECTIVES:
To construct a microprocessor/microcontroller circuit using Arduino Uno with slideswitches as input
components and resistors and a 7-segment display as output components.
To program a microprocessor/microcontroller circuit based on the required output. In this module, the
required output is based on the operations of the binary-to-octal conversion (For example, if the
statuses of the three (3) slideswitches are HIGH, the 7-segment will display a value 7).
LIST OF COMPONENTS:
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:
#define inputSwitch1 9
#define inputSwitch2 10
#define inputSwitch3 11
#define segmentA 3
#define segmentB 2
#define segmentC 6
#define segmentD 7
#define segmentE 8
#define segmentF 4
#define segmentG 5
int i;
int SW1 = LOW, SW2 = LOW, SW3 = LOW;
void setup() {
for(i=0; i<3; i++)
pinMode(inputSwitches[i], INPUT);
void loop() {
SW1 = digitalRead(inputSwitch1);
SW2 = digitalRead(inputSwitch2);
SW3 = digitalRead(inputSwitch3);
delay(1);
COLLEGE OF TECHNOLOGY
COLLEGE OF TECHNOLOGY
COLLEGE OF TECHNOLOGY
Submitted To: