Pages: 1 2 [3]   Go Down
Author Topic: Arduino +Sparkfuns 4-digit 7-segment 16pin display  (Read 26318 times)
0 Members and 2 Guests are viewing this topic.
Lincoln, NE
Offline Offline
Full Member
***
Karma: 0
Posts: 106
Having lots of fun with Arduino. Thanks everyone!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah...
If you take a look at RefreshDisplay(), you will find two lines similar to this:
digitalWrite(digit0 + digitPosition, LOW);  // Turn off previous digit

Each digit is turned on one at a time, so the above line turn off the previously on digit, adjust the segments for the next digit, and then turn on that next digit.

You should be able to adjust the calculation of the first parameter instead of re-wiring the circuit.  Maybe something like this:
1. Change digit0 from 10 to 13
2. digitalWrite(digit0 - digitPosition, LOW);  // Turn off previous digit
3. digitalWrite(digit0 - digitPosition, HIGH);
Logged

0
Offline Offline
Faraday Member
**
Karma: 49
Posts: 6017
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

in this way the millis are correctly on the right, but the other 3 left display is off

But in the original Anode common display all are correct ? it is strange, because you are only modified the code for the Common cathode part.
« Last Edit: October 10, 2010, 02:20:19 pm by testato » Logged

- [Guida] IDE - http://goo.gl/ln6glr
- [Lib] ST7032i LCD I2C - http://goo.gl/GNojT6
- [Lib] PCF8574+HD44780 LCD I2C - http://goo.gl/r7CstH

Lincoln, NE
Offline Offline
Full Member
***
Karma: 0
Posts: 106
Having lots of fun with Arduino. Thanks everyone!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, in the original circuit and sketch, digits are displayed in proper sequence.
There was an error in original dataspecs, so maybe you're running into something similar with your display? I don't know.
Logged

0
Offline Offline
Faraday Member
**
Karma: 49
Posts: 6017
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe I understand the problem, the programmer in general (I'm not a programmer) when write code for display name the most right digit DIGIT0, or DIGIT1.

IN the datasheet normally the name of digit is from rihgt to left.

that's all  smiley

thanks
Logged

- [Guida] IDE - http://goo.gl/ln6glr
- [Lib] ST7032i LCD I2C - http://goo.gl/GNojT6
- [Lib] PCF8574+HD44780 LCD I2C - http://goo.gl/r7CstH

Pages: 1 2 [3]   Go Up
Jump to: