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

Arduino1

The document outlines a project using two Seven-Segment Displays (SSD) with an Arduino Uno to display numbers from 00 to 99. It details the components required, the differences between Common Anode and Common Cathode SSDs, and provides code snippets for setting up and displaying the numbers. The project emphasizes the importance of using resistors to prevent damage to the LEDs.

Uploaded by

neetavalecha922
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Arduino1

The document outlines a project using two Seven-Segment Displays (SSD) with an Arduino Uno to display numbers from 00 to 99. It details the components required, the differences between Common Anode and Common Cathode SSDs, and provides code snippets for setting up and displaying the numbers. The project emphasizes the importance of using resistors to prevent damage to the LEDs.

Uploaded by

neetavalecha922
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

00 to 99 on Seven-Segment

Displays
Tarkeshwar Barua
Introduction

Using two Seven-Segment Displays (SSD)
simultaneously on an Arduino Uno Board to
display numbers from 00 to 99, without
charlieplexing.

https://youtu.be/DX4C2TXzLEE

2
3
Project Requirement

Arduino Uno - 1

Programmer Cable - 1

Seven-Segment Display - 2

Bread Board - 1

Male-Male Jumper Wires

4
Project description

There are two types- Common Anode and Common Cathode.

Here I have used two Common Anode SSDs.

If you are using Common Cathode ones, You just need to convert
the 0's to 1's and the vice-versa.

We will be using the pins from 0 to 13 on the Arduino Board, not
connecting the dot as we do not require it.

SSD(1) here refers to the SSD which displays the tens digit.

SSD(2) here refers to the SSD which displays the ones digit.

5
Project description


Attach the pins 3 and 8 on both the SSD's to 3.3V.(Use resistors)

Since this is for Common Anode SSD, the LED glows when it is
LOW/0.

If you are using a Common Cathode SSD, attach pins 3 and 8 to
ground and then the LEDs glow when attached to HIGH/1.

Do not let 5 V pass through any of your LEDs, You must use
resistors.
6

Result: Numbers from 00 to 99 are displayed.
//SSD is Seven-Segment Display

void setup()
Code
{
for (int i = 0; i <= 13; i++)
pinMode(i, OUTPUT); //Set all pins from 0 to 13 as OUTPUT
}
//The line below is the array containing all the binary numbers for the digits on a SSD from 0 to 9
const int number[11] = {0b1000000, 0b1111001, 0b0100100, 0b0110000, 0b0011001, 0b0010010, 0b0000010, 0b1111000,
0b0000000, 0b0010000};

void loop()
{
for (int tens = 0; tens < 10; tens++)

{
display_tens(tens);
}
}

void display_tens(const int tens)


{
int pin1, a, ones; 7
//pin1 is just used to deal with pins of the 1st SSD which desplays the tens digit
//SSD is Seven-Segment Display

void setup() Code


{
for (int i = 0; i <= 13; i++)
pinMode(i, OUTPUT); //Set all pins from 0 to 13 as OUTPUT
}
//The line below is the array containing all the binary numbers for the digits
on a SSD from 0 to 9
const int number[11] = {0b1000000, 0b1111001, 0b0100100, 0b0110000, 0b0011001,
0b0010010, 0b0000010, 0b1111000, 0b0000000, 0b0010000};

void loop()
{
for (int tens = 0; tens < 10; tens++)

{
display_tens(tens);
}
}

void display_tens(const int tens)


{
int pin1, a, ones;
//pin1 is just used to deal with pins of the 1st SSD which desplays the tens
8
digit
Code
for (pin1 = 0, a = 0; pin1 < 7; pin1++, a++)
{
digitalWrite(pin1, bitRead(number[tens], a));
}
for (ones = 0; ones < 10; ones++)
{
display_ones(ones);
delay(300);
//I have given a delay of 300 milliseconds. You can put your own Time!!
}
}

void display_ones(const int x)


{ int pin2, b;
//pin2 is just used to deal with pins of the 2nd SSD which desplays the
ones digit

for (pin2 = 7, b = 0; pin2 <= 13; pin2++, b++)


{
digitalWrite(pin2, bitRead(number[x], b));

} 9
10

You might also like