0% found this document useful (0 votes)
13 views

Philippine College of Science and Technology: Assignment 10 Seven Segment Display and Analog Interface

The document discusses seven segment displays and how to interface them with microcontrollers. It provides explanations of how seven segment displays work, how to determine common anode vs common cathode, and how to determine pinouts. It also includes code examples to light an LED, and display the number 3 on a seven segment display.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Philippine College of Science and Technology: Assignment 10 Seven Segment Display and Analog Interface

The document discusses seven segment displays and how to interface them with microcontrollers. It provides explanations of how seven segment displays work, how to determine common anode vs common cathode, and how to determine pinouts. It also includes code examples to light an LED, and display the number 3 on a seven segment display.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

PHILIPPINE COLLEGE OF SCIENCE AND TECHNOLOGY

Old Nalsian Road, Nalsian, Calasiao, Pangasinan, Philippines 2418


Tel. No. (075)522-8032/Fax No. (075)523-0894/Website: www.philcst.edu.ph
ISO 9001:2015 CERTIFIED, Member: Philippine Association of Colleges and Universities (PACU),
Philippine Association of Maritime Institutions (PAMI)

Assignment 10
Seven Segment Display and Analog Interface

1. Explain how a seven segment display works.

The 7-segment displays are really just seven LEDs lined up in a particular pattern. ... Each of the seven LEDs is
called a segment because when illuminated the segment forms part of a numerical digit (both Decimal and
Hex) to be displayed. An additional 8th LED is sometimes used for indication of a decimal point.

2. Create a simple program to light up an LED with the anode connected to a digital pin.
int led = 13; // The LED is attached to pin 13

/*
The statements in the "setup()" function are executed once when the
program starts.
*/
void setup(){
pinMode(led, OUTPUT); // Make pin 13 an output.
}

/* The statements in "loop()" are exectuted sequentially forever. */


void loop(){
digitalWrite(led, HIGH); // Turn the LED on by making pin 13 a high voltage.
delay(1000); // Delay for 1 second
digitalWrite(led, LOW); // Turn the LED off
delay(1000); // Delay for 1 second
}

3. Explain how to determine a common anode or common cathode display.


If the LED lights up, it is common ANODE. If no segment lights up then you need to reverse the wiring. So swap
the two wires over on the battery or supply, if the LED lights up now it is common CATHODE.

4. Explain how to determine the pinout of a seven segment display.

A 7 segment display is made of seven different illuminating segments. These are arranged in a way to form
numbers and characters by displaying different combinations of segments. The binary information is
displayed using these seven segments. LED or light emitting diode is P-N junction diode which emits the
energy in the form of light, differ from normal P-N junction diode which emits in the form of heat. Whereas
LCD use properties of liquid crystal for displaying and do not emit the light directly. These LED’s or LCD’s are
used to display the required numeral or alphabet.
5. Create a program that will display number “3” to a single seven segment display.
#include "SevSeg.h"
SevSeg sevseg;

void setup(){
byte numDigits = 1;
byte digitPins[] = {};
byte segmentPins[] = {6, 5, 2, 3, 4, 7, 8, 9};
bool resistorsOnSegments = true;

byte hardwareConfig = COMMON_CATHODE;


sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments);
sevseg.setBrightness(90);
}

void loop(){
sevseg.setNumber(3);
sevseg.refreshDisplay();
}

You might also like