Arduino 7 segment

Show All Items

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

Arduino 7 segment
Arduino 7 segment

Show All Items

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

Arduino 7 segment

Show All Items

For details, look to the picture…

It’s easy if you understand it

Step 3: Putting everything together

Black wire in the middle is GND”, “top”: 0.12896825396825398, “height”: 0.099206349206349201, “width”: 0.21610169491525424, “id”: “N5XDT9BIEWNKNZ4”, “left”: 0.2902542372881356}]’ src=”http://cdn.instructables.com/FA8/8HWY/IEWNKNQ5/FA88HWYIEWNKNQ5.MEDIUM.jpg” /> Show All Items

Schematics in the picture

Don’t forget the 220 resistors!

Step 4: The program code

Arduino 7 segment

Show All Items

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!

arduino – Arduino 7 segment, in category: technology