Tutorial on how to make a Single digit 7 segment Count Up
ฝัง
- เผยแพร่เมื่อ 6 ก.พ. 2025
- In this video tutorial, we show you how to connect a single digit 7 segment display to a breadboard, connect the Vcc (power) and gnd (ground) jumper wires. As a prerequisite, you should read our brief tutorial to learn what a single digit 7 segment display is and how they work (www.jayconsyst.... All components can be located at www.Jayconsystems.com website, and are also included in the Arduino Starter Kits (beginner, and intermediate).
Part 1:
www.jayconsyst...
The code can be found on Part 2: www.jayconsyst...
My teacher said that this is very helpful tutorial
Doporučuje pan učitel pedro 10/10 rezetů
Tank very much Master..good.
Great video and site. Was able to make this using a nano without any issues.
dont you need a resistor for this?
It works, first go, amazing!
Thanks very much.
Good to hear! You're welcome😊
Thanks for your video!
Great video thanks
Wooow. That's great...keep it Bro
Thank you!
THANK YOU for sharing these . Very simple explanation and easy to folow . Do You have more video with Arduino ?. I am at the first steps with it and You way to explain was great and easy for me to understand . THANKS .
Be well and stay Safe .
7D instead 7C on num6. And thanks for tutorial.
Thank u man you helped me a lot :)
New to all this , but the LED was to bright , might burn out , so added a 1k ohm resistor to the ground lead and this worked ok. Not sure if that was the best way to do it ! . Anyone else do it this way ?.
Shouldn't you use resistors? Blowing 5V through that display will ruin it.
@3:27 you guys can't follow the video to found the code!!?
www.jayconsystems.com/tutorial/s7sd/
int A = 7; //Defines all pins on the Arduino Uno board in order of connection.
int B = 6;
int C = 4; // DOT is pin 5, not used in this example.
int D = 3;
int E = 2;
int F = 8;
int G = 9;
byte num0 = 0x3F; //Hexadecimal format based upon the A-G, 0-9 Chart in excel and the wiring // of the segment (refer to the on/off table image below).
byte num1 = 0x6;
byte num2 = 0x5B;
byte num3 = 0x4F;
byte num4 = 0x66;
byte num5 = 0x6D;
byte num6 = 0x7C;
byte num7 = 0x7;
byte num8 = 0x7F;
byte num9 = 0x6F;
void on(byte num) // This function turns on the correct pins to display numbers passed to it // through the variable "num".
{
int result = bitRead(num, 0); // Read the first binary entry in num and stores it in result.
if (result == 1) // Check to see if this segment should be on.
{digitalWrite(A, HIGH);} // Turns on the segment.
else // Otherwise, it turns it off.
{digitalWrite(A, LOW);} // Turns segment off.
result = bitRead( num, 1); // Same thing for the 6 remaining segments.
if (result == 1)
{digitalWrite(B, HIGH);}
else
{digitalWrite(B, LOW);}
result = bitRead( num, 2);
if (result == 1)
{digitalWrite(C, HIGH);}
else
{digitalWrite(C, LOW);}
result = bitRead( num, 3);
if (result == 1)
{digitalWrite(D, HIGH);}
else
{digitalWrite(D, LOW);}
result = bitRead( num, 4);
if (result == 1)
{digitalWrite(E, HIGH);}
else
{digitalWrite(E, LOW);}
result = bitRead( num, 5);
if (result == 1)
{digitalWrite(F, HIGH);}
else
{digitalWrite(F, LOW);}
result = bitRead( num, 6);
if (result == 1)
{digitalWrite(G, HIGH);}
else
{digitalWrite(G, LOW);}
}
void setup() { // Our setup routine
pinMode(A, OUTPUT); // Making all pins outputs
pinMode(B, OUTPUT);
pinMode(C, OUTPUT);
pinMode(D, OUTPUT);
pinMode(E, OUTPUT);
pinMode(F, OUTPUT);
pinMode(G, OUTPUT);
pinMode(10,OUTPUT);
}
void loop() { // Loops forever
on(num0); // Passing "num0" to the function "on()" defined above to display "0"
delay(1000); // Delay for 1 second to see the "0"
on(num1); // Change to "1"
delay(1000);
on(num2);
delay(1000);
on(num3);
delay(1000);
on(num4);
delay(1000);
on(num5);
delay(1000);
on(num6);
delay(1000);
on(num7);
delay(1000);
on(num8);
delay(1000);
on(num9);
delay(1000);
}
@@abdelnacer7721 thank you, i get a 404 error when i go the site with the code
thank you sir.
Would be nice for a higher resolution video, great work tho, thanks
9 years :D
I have a 3 digit common cathode display i am trying to figure out how to wire properly. Could you explain a little more about wiring?
int bottomLeft = 2;
int bottomMiddle = 3;
int bottomRight = 4;
int dot = 5;
int topRight = 6;
int topMiddle = 7;
int topLeft = 8;
int center = 9;
void on(int num) {
digitalWrite(bottomLeft, (num == 2 || num == 6 || num == 8 || num == 0));
digitalWrite(bottomMiddle, (num == 2 || num == 3 || num == 5 || num == 6 || num == 8 || num == 0));
digitalWrite(bottomRight, (num == 1 || num == 3 || num == 4 || num == 5 || num == 6 || num == 7 || num == 8 || num == 9 || num == 0));
digitalWrite(center, (num == 2 || num == 3 || num == 4 || num == 5 || num == 6 || num == 8 || num == 9));
digitalWrite(topLeft, (num == 4 || num == 5 || num == 6 || num == 8 || num == 9 || num == 0));
digitalWrite(topMiddle, (num == 2 || num == 3 || num == 5 || num == 6 || num == 7 || num == 8 || num == 9 || num == 0));
digitalWrite(topRight, (num == 1 || num == 2 || num == 3 || num == 4 || num == 7 || num == 8 || num == 9 || num == 0));
}
void setup() { // Our setup routine
for(int i = 2; i < 10; i++){
pinMode(i, OUTPUT);
}
}
void loop() { // Loops forever
for (int i = 0; i < 10; i++) {
on(i);
delay(1000);
}
}
your a mad lad. Thankyou
what type of 7 segments do you use?? anode or cathode?
is the connections for a common anode display? im new to arduino
and im just a kid
this tutorial is the most frustrating thing this side of the Mississippi
pin 1 = bottom left
pin 2 = bottom
pin 4 = bottom right
pin 5 = point
pin 6 = top right
pin 7 = top
pin 9 = top left
pin 10 = middle
if you put a current to the respective pins and have grounds connected, respective segments light up.
the config works with the first pin being bottom left, where the dot is facing you.
Thanks Bro
Your code on the website is missing. Please fix it!!
cool, but the numbers are too bright, is it possible to give less power to the display?
it might be too late but you could and should use resistors if you dont want to damage the display
Optimized Code. Took 45 minutes to from "How do I do this, let's watch the tutorial" to testing this optimized version out and posting it here.
int bottomLeft = 2;
int bottomMiddle = 3;
int bottomRight = 4;
int dot = 5;
int topRight = 6;
int topMiddle = 7;
int topLeft = 8;
int center = 9;
void on(int num) {
digitalWrite(bottomLeft, (num == 2 || num == 6 || num == 8 || num == 0));
digitalWrite(bottomMiddle, (num == 2 || num == 3 || num == 5 || num == 6 || num == 8 || num == 0));
digitalWrite(bottomRight, (num == 1 || num == 3 || num == 4 || num == 5 || num == 6 || num == 7 || num == 8 || num == 9 || num == 0));
digitalWrite(center, (num == 2 || num == 3 || num == 4 || num == 5 || num == 6 || num == 8 || num == 9));
digitalWrite(topLeft, (num == 4 || num == 5 || num == 6 || num == 8 || num == 9 || num == 0));
digitalWrite(topMiddle, (num == 2 || num == 3 || num == 5 || num == 6 || num == 7 || num == 8 || num == 9 || num == 0));
digitalWrite(topRight, (num == 1 || num == 2 || num == 3 || num == 4 || num == 7 || num == 8 || num == 9 || num == 0));
}
void setup() { // Our setup routine
for(int i = 2; i < 10; i++){
pinMode(i, OUTPUT);
}
}
void loop() { // Loops forever
for (int i = 0; i < 10; i++) {
on(i);
delay(1000);
}
}
I used arduino mega, I follow the pin configuration, 7segments pins (3 and 8) are connected to the gnd. I used the ur code and the code by brandon day but it doesn't seem to work on me
New Location For The Code: jayconsystems.com/blog/programming-a-single-7-segment-display
do you have any codes for that? i need this as soon as possible
Why is it so blurry
Hi ...it did not work for me. I have arduino ATMEGA 8A which is an older version. can u tell me where lies the problem , everything is done as per your instructions in the video.
ser do you have a .js code for this. i really need it for our exam
4 digits single of 7 segment? how do?
dear sir
could you please help me for fix voice in arduino
there's no code @ the link!
you don$t need soending in a microcontroller for that. A very inexpensive IC can do the job
There is no code for the arduino. plesae fix it.
+MANRACLE GAMING he wrote down the wrong website
www.jayconsystems.com/tutorials/cat/basic-electronics/post/s7sd/
2012?
i got just numbers 1,2,3 and 7. help please
You have wrong sticks or the wrong 7 seggent.
Used this without resistors and now that segment dosn't work
220 was very bright, 2.2k worked well though
404 error....
WHERE THE HELL IS THE CODE
404 error.. :(
no code :(
Your code is too long for a good programmer, try to make it short. :)
Romuald KOUAMI TCHAMBA i saw this comment and agreed. what do you think of this?
int bottomLeft = 2;
int bottomMiddle = 3;
int bottomRight = 4;
int dot = 5;
int topRight = 6;
int topMiddle = 7;
int topLeft = 8;
int center = 9;
void on(int num) {
digitalWrite(bottomLeft, (num == 2 || num == 6 || num == 8 || num == 0));
digitalWrite(bottomMiddle, (num == 2 || num == 3 || num == 5 || num == 6 || num == 8 || num == 0));
digitalWrite(bottomRight, (num == 1 || num == 3 || num == 4 || num == 5 || num == 6 || num == 7 || num == 8 || num == 9 || num == 0));
digitalWrite(center, (num == 2 || num == 3 || num == 4 || num == 5 || num == 6 || num == 8 || num == 9));
digitalWrite(topLeft, (num == 4 || num == 5 || num == 6 || num == 8 || num == 9 || num == 0));
digitalWrite(topMiddle, (num == 2 || num == 3 || num == 5 || num == 6 || num == 7 || num == 8 || num == 9 || num == 0));
digitalWrite(topRight, (num == 1 || num == 2 || num == 3 || num == 4 || num == 7 || num == 8 || num == 9 || num == 0));
}
void setup() { // Our setup routine
for(int i = 2; i < 10; i++){
pinMode(i, OUTPUT);
}
}
void loop() { // Loops forever
for (int i = 0; i < 10; i++) {
on(i);
delay(1000);
}
}
All this "tutorial" does is show somehow how to copy someone else's work. It doesn't show you anything but copy/paste. What a waste of time!