Philippine College of Science and Technology: Assignment 10 Seven Segment Display and Analog Interface
Philippine College of Science and Technology: Assignment 10 Seven Segment Display and Analog Interface
Assignment 10
Seven Segment Display and Analog Interface
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.
}
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;
void loop(){
sevseg.setNumber(3);
sevseg.refreshDisplay();
}