Go Down

Topic: Arduino +Sparkfuns 4-digit 7-segment 16pin display (Read 27 times) previous topic - next topic

hari

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);

Testato

#31
Oct 10, 2010, 09:16 pm Last Edit: Oct 10, 2010, 09:20 pm by testato Reason: 1
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.
- [Guida] IDE - http://goo.gl/ln6glr
- [Lib] ST7032i LCD I2C - http://goo.gl/GNojT6
- [Lib] PCF8574+HD44780 LCD I2C - http://goo.gl/r7CstH

hari

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.

Testato

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  :)

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

Go Up