Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vmapper #1009

Merged
merged 7 commits into from
Mar 18, 2020
Merged

Vmapper #1009

merged 7 commits into from
Mar 18, 2020

Conversation

marcmerlin
Copy link
Collaborator

@marcmerlin marcmerlin commented Mar 18, 2020

Fixes #1003

Ok, this was more work than I thought for something seemingly simple (well, it's likely just that I suck at it), but it works!
Hopefully this puts me in the lead for the highest usable resolution display on a single rPi (384x256) :)
401_20200310_FastLED_RPIRGBPanel_GFX_384x256

@hzeller
Copy link
Owner

hzeller commented Mar 18, 2020

Cool!
Only potential user-support issue I see is that the panels are fed from the top while the 'usual' way is to feed them from the right.

So to reduce potential user-support in the future, I suggest to not deviate too much from the 'things are fed from the right side', and think about stuff rotated by 90 degrees (it is probably just a little x/y swap fiddle somewhere).

To make sure there is no confusion about how to connect each of these panels, can you add an text-art that indicates how they are exactly chained ? I find that the Macron-Character is excellent for this kind of stuff:

[v]¯\_[v]¯\_[v]¯\_[v]¯ ch1
[v]¯\_[v]¯\_[v]¯\_[v]¯ ch2
[v]¯\_[v]¯\_[v]¯\_[v]¯ ch3

(if you still want to operate it from the top in your specific application, you then can use the Rotate transformation to get it back rotated)

@hzeller
Copy link
Owner

hzeller commented Mar 18, 2020

(also, this brings out much more of the V-ness)

@marcmerlin
Copy link
Collaborator Author

marcmerlin commented Mar 18, 2020

Mmmh, so the whole point of vmapper is that the panels are fed up-down. Sure, I can rotate everything and then force the use of a second rotate:90 mapper to get it the way you're suggesting, but the whole point of V-mapper is that the panels are fed from up to down (or down to up).

I think you're saying that I can pretend that my panel is like this, is that what you meant?
image

If so, I'm not sure I'm not sure if your suggestion actually makes thing more obvious given that the point of V stacking is that you want matrix is naturally higher than wide, so it's not very obvious to rotate it 90 degrees. In that picture the panel is rotated so that it fits better in the picture, but in actual use, it is up-down.
That said, if somehow you have a usage case where you want it that way, you can always use rotate:90, but by default I think it ought to be the way I coded it, wouldn't you agree?
I'm happy to change the ASCII to show how the wiring is (as per your suggestion).
Would that sole change be ok?

@hzeller
Copy link
Owner

hzeller commented Mar 18, 2020

mmh ok, so the reason why you want to feed it from the top is that then the panels are 'upright' as they are meant to be ? (because sometimes the LED shielding sideways is a little different than up/down). I could be convinced by that.

Let's do the ASCII art improvement for now, but since you turn it 90 degrees than in my suggestion, you probably need some sort of 'right side pipe symbol' and 'left side pipe symbol' and backslash to illustrate.

@marcmerlin
Copy link
Collaborator Author

marcmerlin commented Mar 18, 2020

Just to answer your question, yes, the panels are upright as they were meant to be, check the picture I included at the top.
This is their natural position given the writing on the back, so I felt it made sense to keep them that way by default.
Of course if someone needs a resolution that is the other way around, they can use rotate.

Ch1 Ch2 Ch3
v v v
[I > O] [I > O] [I > O]
,---' ,---' ,---'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, pretty :)

Copy link
Owner

@hzeller hzeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the natural direction of these panels is actually with the input on the right side, so right now they are upside down. So we still have to change that and 180 degree change it.

(I have seen outdoor panels that actually have a strong directional component downwards as they are meant to to be mounted high-up)

(In the case of your set-up that means you have to then Rotate:180 the output if you can't have the Pi at the bottom of the display)

@marcmerlin marcmerlin requested a review from hzeller March 18, 2020 15:02
@hzeller
Copy link
Owner

hzeller commented Mar 18, 2020

Do you have a picture of the panel backside ? Every panel I have ever seen has the input on the right side (seeing from the face of the panel), not on the left.

@hzeller
Copy link
Owner

hzeller commented Mar 18, 2020

Looking at the three-chained V-example you have above, I don't see arrows but the text is indeed up only if the input is on the right.

So looking to the front of the panel, the input is on the right, so we need to make sure to have the code reflect that.

@marcmerlin
Copy link
Collaborator Author

IMG_20200318_090455

@hzeller
Copy link
Owner

hzeller commented Mar 18, 2020

See, input is on the right of the panel, output on the left
(looking from the back, the input is on the left, output on the right)

@marcmerlin
Copy link
Collaborator Author

marcmerlin commented Mar 18, 2020

connector is left when seen from the back, right when seen from the LED (front) side.
The new graph I sent you is showing I on the left which is where it is when you are wiring the panels and the connectors are facing you.
Regardless of whether we show one side or the other, it should be clear enough to someone repeating this hopefully :)
That said if you feel strongly about the graph showing from the LED side, which ultimately is not the side you see when you are wiring, I can flip it around for you.

@hzeller
Copy link
Owner

hzeller commented Mar 18, 2020

The wiring diagrams in all of the rpi-rgb-led-matrix done are all with the panel fronts looking toward you.
So if you have this already wired and programmed this way, then just the graphics needs to be flipped.

@marcmerlin
Copy link
Collaborator Author

Sure, PTAL

*matrix_x = (x % panel_width) + int(y/panel_height)* panel_width;
*matrix_y = (y % panel_height) + int(x/panel_width) * panel_height;

//fprintf(stderr, "%s: Panel-W:%d Panel-H:%d. X: %3d -> %3d, Y: %3d -> %3d\n",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't leave commented-out code in the final version.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I left it there on purpose it case it helps someone (possibly me) writing the next mapper. Understanding how things worked without it would have been hard (it was non obvious to see how things were mapped)
If you'd prefer, I can put it under an #ifdef 0 or something else, though, but if you really don't want it, I can remove it and apply it again in my tree as I will definitely want it again in the future if I write another mapper.
What's your call?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing commented-out here. Someone who will want to debug this will add something very similar in the working copy, but here, we should leave out the clutter.

Also above in the GetSizeMapping(), the output should not be there, but you can #if 0 that out if you want.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, PTAL

@hzeller
Copy link
Owner

hzeller commented Mar 18, 2020

Cool, almost ready to go: just some leftover debug printf to be removed.

@marcmerlin marcmerlin requested a review from hzeller March 18, 2020 17:14
@hzeller hzeller merged commit 7032742 into hzeller:master Mar 18, 2020
@hzeller
Copy link
Owner

hzeller commented Mar 18, 2020

Thanks for your contribution! Merged.

@hzeller
Copy link
Owner

hzeller commented Mar 18, 2020

Do you have a picture of the back of your panel that you'd like to share ? I think similar to the U-mapper example image, that will help people in the wiring.

@marcmerlin
Copy link
Collaborator Author

@hzeller I don't have rails, it's sadly all like just sitting on my desk, so I can't really flip it around
The picture I gave upthread of a single set of 3 panels is basically what a chain looks like (different panel, but identical wiring)

@marcmerlin
Copy link
Collaborator Author

@hzeller Well, I will owe you a new matter soon, Vumapper :)

IMG_20200320_174205
And I have the back of this one
IMG_20200320_174436

@hzeller
Copy link
Owner

hzeller commented Mar 21, 2020

You're really going to town with these panels :)

@marcmerlin
Copy link
Collaborator Author

those old 64x32 panels that were donated to me, were gathering dust, I felt bad about it, and like many I have a few extra hours at home right now :)
Don't worry, after a not too long while, I'll get bored with this, and switch to another hobby like RC planes :)

@rijotech
Copy link

I'm trying to replicate the panels setup but can't seen to find the right set of commands to get a straight image. @marcmerlin care to provide an example? I already haverything wired the same way with 12 64x32 panels.

@marcmerlin
Copy link
Collaborator Author

marcmerlin commented Mar 27, 2020

@rijotech please try
~/rpi-rgb-led-matrix/examples-api-use/demo --led-gpio-mapping=regular --led-rows=32 --led-cols=64 --led-row-addr-type=0 --led-chain=4 --led-show-refresh --led-slowdown-gpio=1 --led-parallel=3 --led-panel-type=FM6126A --led-pwm-bits=7 --led-pwm-dither-bits=1 --led-pixel-mapper=V-Mapper:Z -D0
If that fails, please post picture of what you are seeing.
Obviously, your led chain will be 4 for 3x4 panels (mine was 5)

@rijotech
Copy link

@rijotech please try
~/rpi-rgb-led-matrix/examples-api-use/demo --led-gpio-mapping=regular --led-rows=32 --led-cols=64 --led-row-addr-type=0 --led-chain=4 --led-show-refresh --led-slowdown-gpio=1 --led-parallel=3 --led-panel-type=FM6126A --led-pwm-bits=7 --led-pwm-dither-bits=1 --led-pixel-mapper=V-Mapper:Z -D0
If that fails, please post picture of what you are seeing.
Obviously, your led chain will be 4 for 3x4 panels (mine was 5)

Thanks a lot @marcmerlin I already figured out I cloned your repo and figure it how to make it work. Thanks to you both! and stay with this pandemic.

@lehni
Copy link

lehni commented Jan 21, 2022

@marcmerlin is there a way to reverse the sequence of the chains, so I can go right to left, bottom to top in my wiring?

@hzeller
Copy link
Owner

hzeller commented Jan 21, 2022

could you use use the mirror or rotate mappers stacked on the v-mapper ?

@marcmerlin
Copy link
Collaborator Author

Henner's answer is best, my code was indeed only written for one direction, but hopefully the transforms on top will sort you out

@lehni
Copy link

lehni commented Jan 22, 2022

I've reversed the cable routing instead, all good :) Thank you both for the quick feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No support for panels stacked up high instead of wide?
4 participants