Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[AVR] 7 segment interfacing with arduino

Status
Not open for further replies.

ejbiswas

Newbie level 5
Joined
Jun 28, 2015
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Bangladesh
Activity points
66
i use a 4 digit seven segment display for my project. but it need to show a number in first 5 second and then other for 5 sec, then the previous one is shown and the loop will be continued. for this i use the program but it shows 0000 .
#################################################

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
void loop() {
 
  print_seg(10.76);
  delay(5000);
  print_seg(89.45);
  delay(5000);
  
  
}
 
 
void print_seg(float num)
{
  dig1=num/10 ;
    num1=num- (10*dig1);
    dig2=num1/1;
    num2=num1-(1*dig2);
    num3=num2*100;
    dig3=num3/10;
    num4=num3-(10*dig3);
    dig4=num4/1;
  
   digitalWrite( GND4, LOW);    //digit 4
  pickNumber(dig4);
  delay(DTime);
  digitalWrite( GND4, HIGH);
  
  digitalWrite( GND3, LOW);    //digit 3
  pickNumber(dig3);
  delay(DTime);
  digitalWrite( GND3, HIGH);
  
  digitalWrite( GND2, LOW);  //digit 2
  pickNumber(dig2);
  digitalWrite( DP, HIGH);
  delay(DTime);
  digitalWrite( GND2, HIGH);
   digitalWrite( DP, LOW);
  
  digitalWrite( GND1, LOW);   //digit 1
  pickNumber(dig1);
  delay(DTime);
  digitalWrite( GND1, HIGH);
 
}

 
Last edited by a moderator:

Can you change the float to Integer, also change number from decimal. Test and observe.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top