Editor Version ×
Standard

1.Easy to use and quick to get started

2.The process supports design scales of 300 devices or 1000 pads

3.Supports simple circuit simulation

4.For students, teachers, creators

Profession

1.Brand new interactions and interfaces

2.Smooth support for design sizes of over 5,000 devices or 10,000 pads

3.More rigorous design constraints, more standardized processes

4.For enterprises, more professional users

Ongoing

STD 4 Digital 7segment Display

License:

Mode: Editors' pick

Cloned from 4 Digital 7segment Display

  • 495
  • 0
  • 0
Update time: 2018-03-09 19:48:08
Creation time: 2018-03-09 19:48:05
Description
## 4 Digital 7segment Display ## This article is the use of Arduino MEGA 2560 board to drive some of the color LED digital tube.All of the content is edit in the edit in the easyeda.com Usually in the production , the 4-digital 7 segment LED display is a lot of advantages, in the network, we can see many users in the difficult search related projects. Here we come to design a Arduino 7 digital four-segment LED display program. The 4 digital led is a collection in one package, the peripheral pin is very few, the connection is simple. The circuit schematic diagram based on the easyeda.com website design, easyeda can find the design of the source file, you can change after you as your own design. **program code**

int a = 37;
int b = 36;
int c = 35;
int d = 34;
int e = 33;
int f = 32;
int g = 31;
int p = 30;
int d4 = 38;
int d3 = 39;
int d2 = 40;
int d1 = 41;
long n = 0;
int m = 100;
int delay = 100;  
  
byte segs[7] = { a, b, c, d, e, f, g };
 
byte seven_seg_digits[10][7] = { { 0,0,0,0,0,0,1 },  // = 0
                                 { 1,0,0,1,1,1,1 },  // = 1
                                 { 0,0,1,0,0,1,0 },  // = 2
                                 { 0,0,0,0,1,1,0 },  // = 3
                                 { 1,0,0,1,1,0,0 },  // = 4
                                 { 0,1,0,0,1,0,0 },  // = 5
                                 { 0,1,0,0,0,0,0 },  // = 6
                                 { 0,0,0,1,1,1,1 },  // = 7
                                 { 0,0,0,0,0,0,0 },  // = 8
                                 { 0,0,0,0,1,0,0 }   // = 9
                             }; 
 
void setup()
{
  pinMode(d1, OUTPUT);
  pinMode(d2, OUTPUT);
  pinMode(d3, OUTPUT);
  pinMode(d4, OUTPUT);
  pinMode(a, OUTPUT);
  pinMode(b, OUTPUT);
  pinMode(c, OUTPUT);
  pinMode(d, OUTPUT);
  pinMode(e, OUTPUT);
  pinMode(f, OUTPUT);
  pinMode(g, OUTPUT);
  pinMode(p, OUTPUT);
}
 
void loop()
{
  clearLEDs();
  pickDigit(1);
  lightSegments((n/m/1000)%10);
  delayMicroseconds(delay);
 
  clearLEDs();
  pickDigit(2);
  lightSegments((n/x/100)%10);
  delayMicroseconds(del);
 
  clearLEDs();
  pickDigit(3);
  dispDec(3);
  lightSegments((n/x/10)%10);
  delayMicroseconds(delay);
 
  clearLEDs();
  pickDigit(4);
  lightSegments(n/x%10);
  delayMicroseconds(delay);
 
  n++;
 
}
 
void pickDigit(int x)  
{
  digitalWrite(d1, LOW);
  digitalWrite(d2, LOW);
  digitalWrite(d3, LOW);
  digitalWrite(d4, LOW);
 
  switch(m)
  {
  case 1: 
    digitalWrite(d1, HIGH); 
    break;
  case 2: 
    digitalWrite(d2, HIGH); 
    break;
  case 3: 
    digitalWrite(d3, HIGH); 
    break;
  default: 
    digitalWrite(d4, HIGH); 
    break;
  }
}
 
void dispDec(int m) 
{
  digitalWrite(p, LOW);
}
 
void clearLEDs()  
{
  digitalWrite(a, HIGH);
  digitalWrite(b, HIGH);
  digitalWrite(c, HIGH);
  digitalWrite(d, HIGH);
  digitalWrite(e, HIGH);
  digitalWrite(f, HIGH);
  digitalWrite(g, HIGH);
  digitalWrite(p, HIGH);
}
void lightSegments(int x) {
  for (int i = 0; i 
**The Final vedio**
Design Drawing
schematic diagram
1 /
PCB
1 /
The preview image was not generated, please save it again in the editor.
ID Name Designator Footprint Quantity
1 Arduino MEGA 2560 U1 DIP 1
2 7-SEGMENT-4DIGIT LED1 4-digit-12-pin-0.28-inch 1
3 100 R1,R2,R3,R4,R5,R6,R7,R8 R3 8

Unfold

Project Attachments
Empty
Project Members
Related Projects
Change a batch
Loading...
Add to album ×

Loading...

reminder ×

Do you need to add this project to the album?

服务时间

周一至周五 9:00~18:00
  • 0755 - 2382 4495
  • 153 6159 2675

服务时间

周一至周五 9:00~18:00
  • 立创EDA微信号

    easyeda

  • QQ交流群

    664186054

  • 立创EDA公众号

    lceda-cn