Introduction: Arduino 7 Segment Display

Picture of Arduino 7 Segment Display

I am going to show you how to control a 7 segment display with your arduino!

What is it doing?

It's counting from 1 to 2 to 3 to 4 to 5 to 6 to 7 to 8 to 9 to 0 to . (its really the point)

Step 1: Parts

Picture of Parts

Parts list:

1. 7 segment display module

2. An Arduino uno

3. Jumper wires

4. Breadboard

5. 8 220Ω resistors

Step 2: How the 7 Segment Is Working

Picture of How the 7 Segment Is Working

For details, look to the picture...

It's easy if you understand it

Step 3: Putting Everything Together

Picture of Putting Everything Together

Schematics in the picture

Don't forget the 220Ω resistors!

Step 4: The Program Code

Picture of The Program Code

Here is the code:

void setup() {

pinMode(13, OUTPUT);

pinMode(12, OUTPUT);

pinMode(11, OUTPUT);

pinMode(10, OUTPUT);

pinMode(9, OUTPUT);

pinMode(8, OUTPUT);

pinMode(7, OUTPUT);

pinMode(6, OUTPUT);

}

void loop() {

one();

delay(1000);

off();

two();

delay(1000);

off();

three();

delay(1000);

off();

four();

delay(1000);

off();

five();

delay(1000);

off();

six();

delay(1000);

off();

seven();

delay(1000);

off();

eight();

delay(1000);

off();

nine();

delay(1000);

off();

zero();

delay(1000);

off();

point();

delay(5000);

off();

}

void one(){

digitalWrite(6, HIGH);

digitalWrite(11, HIGH);

}

void two(){

digitalWrite(7, HIGH);

digitalWrite(6, HIGH);

digitalWrite(9, HIGH);

digitalWrite(13, HIGH);

digitalWrite(12, HIGH);

}

void three() {

digitalWrite(11, HIGH);

digitalWrite(12, HIGH);

digitalWrite(7, HIGH);

digitalWrite(6, HIGH);

digitalWrite(9, HIGH);

}

void four() {

digitalWrite(11, HIGH);

digitalWrite(8, HIGH);

digitalWrite(6, HIGH);

digitalWrite(9, HIGH);

}

void five() {

digitalWrite(11, HIGH);

digitalWrite(12, HIGH);

digitalWrite(7, HIGH);

digitalWrite(8, HIGH);

digitalWrite(9, HIGH);

}

void six() {

digitalWrite(13, HIGH);

digitalWrite(12, HIGH);

digitalWrite(11, HIGH);

digitalWrite(9, HIGH);

digitalWrite(8, HIGH);

digitalWrite(7, HIGH);

}

void seven() {

digitalWrite(11, HIGH);

digitalWrite(7, HIGH);

digitalWrite(6, HIGH);

}

void eight() {

digitalWrite(13, HIGH);

digitalWrite(12, HIGH);

digitalWrite(11, HIGH);

digitalWrite(9, HIGH);

digitalWrite(8, HIGH);

digitalWrite(7, HIGH);

digitalWrite(6, HIGH);

}

void nine() {

digitalWrite(12, HIGH);

digitalWrite(11, HIGH);

digitalWrite(9, HIGH);

digitalWrite(8, HIGH);

digitalWrite(7, HIGH);

digitalWrite(6, HIGH);

}

void zero() {

digitalWrite(13, HIGH);

digitalWrite(12, HIGH);

digitalWrite(11, HIGH);

digitalWrite(8, HIGH);

digitalWrite(7, HIGH);

digitalWrite(6, HIGH);

}

void point() {

digitalWrite(10, HIGH);

}

void off() {

digitalWrite(13, LOW);

digitalWrite(12, LOW);

digitalWrite(11, LOW);

digitalWrite(10, LOW);

digitalWrite(9, LOW);

digitalWrite(8, LOW);

digitalWrite(7, LOW);

digitalWrite(6, LOW);

}

Step 5: Done!

Now your done!

I hope you liked it and please share it with your friends =)

You can also experiment now with the 7 segment display!

Comments

Bverysharp (author)2017-05-10

very helpful. thanks!

ZemByte (author)2015-09-24

Awesome!

seamster (author)2015-09-23

Nicely done, thanks for sharing this.

seth hettinga (author)seamster2015-09-23

No problem man!

About This Instructable

1,658views

24favorites

License:

More by seth hettinga:Arduino 7 Segment Display
Add instructable to: