When I use another way to achieve this, the LED are darker, because of the reset-command:
for (int time = 2; time <= 2000; time++) {
digitalWrite(ledPins[0], HIGH);
digitalWrite(ledPins[1], HIGH);
digitalWrite(ledPins[2], HIGH);
digitalWrite(ledPins[3], HIGH);
digitalWrite(ledPins[4], HIGH);
digitalWrite(gndPins[0], LOW);
reset_pins();
}
I asume the for-loop is necessary if you want to display the character X.
I read that the LEDs musst be switched on and off very rapidly, so that the human eye is not recognizing.
Rule 1: Keep all of the row (ground) pins HIGH when changing column (led) pins, otherwise you will get ghosting.
Rule 2: Set all of the column (led) pins for the current row before setting the row (ground) pin LOW. If you set the row (ground) pin LOW while any column (led) pin from the previous row is HIGH you will get ghosting. If you set all of the column (led) pins LOW but set the row (ground) pin LOW before you set the column (led) pins for the row HIGH then the brightness of each column (led) will depend on the order in which you set the pins HIGH.
Rule 3: Put a small delay between setting the one row (ground) pin LOW and setting it HIGH again. Use a delay that just short of causing flicker. Shorter time will give lower brightness and longer time will produce flicker. In my case of 4 rows the time of 3 mS was right.
i spend a little time to think about that. From a mathematical point of view it will never be possible that a X will be bright as a horizontal or vertical row.
With an X you have to switch between off and on. So you will have - and if it is in millisenconds - where LEDs are dark. AFAIK the human I can recognize 17 pictures in one second as single pictures. Everything over 17 is a "movie". But there will be also pictures regongnized as dar pictures. In other words: The LED in an X have to share the time they are spending light.
So and X will ever be darker as a row.
Mario, I mean no offense, but your post makes no sense. Perhaps your English is not very good, but I think it is mainly because you didn't understand the reply. Right now, the best thing you can do is post your entire sketch, so we can see what you are really doing.
From a mathematical point of view it will never be possible that a X (in a 5x5 LED matrix) will be bright as a horizontal or vertical row (where you do not have to reset pins).
With X (in a 5x5 LED matrix) there have to be toggles between off and on.
So you will have a very very short time where LEDs are dark.
AFAIK the human eye can recognize 17 pictures in one second as single pictures.
Everything more than 17 pictures is recognized as motion (like on TV).
But the eye also recognizes the very small dark series! In other words: The LED in an X have to share the time they are lighting and sometimes they are dark.
The sum of lightning time in a row or column is greater than the sum in a X
Conclusion: X will ever be darker as a row or column (where you do not have to reset pins).
Hes trying to teach a guy who could probably build a tv from a bunch of old components that a led turned off and on is not as bright as a led that's left on. At no point did john say that the leds would be as bright. In fact john pointed out that they would be dimmer unless you lengthened the delay to a point that would cause flickering.
First thing I noticed in johns post was "In my case of 4 rows the time of 3 mS was right.". That means he has a working code. So I would have gone with the simple arse kissing approach to get john to post a code in the hope hes written something I could understand.
I liked this response
@gpop1: I tested your suggestion, but the character X is now display to long
Thank you!
@gpop1: Good suggestion
@ Johnwater: Do you have some sample code (e.g. 5 x 5 multiplex)? @aarg: I just wanted to point out, that a code, that has to turn of and on, to display e.g.
X000X
0X00X
00X00
0X0X0
X000X
can never be as bright as a code that has NOT to turn off/on like:
XXXXX
00000
00000
00000
00000
But my assumption was wrong.
There is a workaround
Instead of
switch on X000X > reset pins
switch on 0X00X > reset pins
switch on 00X00 > reset pins
switch on 0X0X0 > reset pins
switch on X000X > reset pins
you could use
switch on X000X
switch on 0X00X > reset (1) : col 1, col5, row 1, row 5 > delayMicros