Hi,
q wrote on 30.11.2007 at 17:57:28:yes, but the other tutorial,the library and code use dig 0 for the first(bottom) rows, is the same for the columns.
I decided to put the origin of the matrix into the top left corner because:
- If you speak of rows and colmuns everybody imagines some like a spreadsheet
- In the mathematical matrix the origin is top,left
- All basic computer graphics programming uses the top/left origin,
From there I think the top/left origin is a bit more natural
You had this example
Quote: my wiring
maxSingle(1,1); // + - - - - - - -
maxSingle(2,2); // - + - - - - - -
maxSingle(3,4); // - - + - - - - -
maxSingle(4,8); // - - - + - - - -
maxSingle(5,16); // - - - - + - - -
maxSingle(6,32); // - - - - - + - -
maxSingle(7,64); // - - - - - - + -
maxSingle(8,128); // - - - - - - - +
With only one Led on, there is no real gain from my wiring, but what if you want something more complicated like a filled triangle pointing right?
This is my wiring:
maxSingle(1, B10000000);
maxSingle(2, B11000000);
maxSingle(3, B11100000);
maxSingle(4, B11110000);
maxSingle(5, B11100000);
maxSingle(6, B11000000);
maxSingle(7, B10000000);
maxSingle(8, B00000000);
You can't do that with your wiring since only decimal values make sense
maxSingle(1,128);
maxSingle(2,192);
maxSingle(3,224);
maxSingle(4,240);
maxSingle(5,224);
maxSingle(6,192);
maxSingle(7,128);
maxSingle(8,0);
With my wiring you need to type more and think less

This whole thing is really is up to personal preferences.
Quote:However is much better if we have a wiring code and consistency in all of turoial, you can add other wiring like an options.
tell me what do you think?
I had a look at the Matrix-library this morning and was surprised that it doesn't even work on a MAX7221 without some minor modifications.
I have not yet found out how they organize their rows/columns thing.
There is no wiring information at at all and it seems they programming is for a specific Ledmatrix product since I found this comment in the sources
Code: // wrap shift relative x for nexus module layout
if (x == 0){
x = 8;
}
--x;
This quirk isn't even documented.
The docs from the other playground article has a mistake in the wiring, (otherwise we wouldn't discuss this topic here).
So what is the correct wiring?I don't know!
I think I will update my playground article with some notice on alternative wiring options and explain that this really is a software thing.
And one more on the row-issue:
The Matrix-Lib uses the index value 0..7 for addressing the rows
The playground article uses 1..8
You see 3 pieces of code 3 different solutions and all of them correct.
Eberhard