board707 / DMD_STM32

STM32Duino library for RGB, Monochrome and Two-color led matrix panels
GNU General Public License v3.0
65 stars 21 forks source link

issues with 1/4 scan for rgb panel #9

Closed bilalibrir closed 2 years ago

bilalibrir commented 2 years ago

I'm having a problem using an RGB (16*32) 1/4 Scan panel with this Library with no succes , the RGB panel has the snake pattern. are you working to implement this feature or not? if not please can you do it and thanks in advance. I tried to read the code but didn't understand most of it. thankyou.

bilalibrir commented 2 years ago

connection

board707 commented 2 years ago

And one more stupid question: do you sure that all your matrices has the same data pattern?

3. is that really a bug in the RGB test code?? or just for me? i don't understand!!

No , it is not a bug and in any case is not your fault. The problem is that I can't find the correct coordinate transformation for these matrices.

board707 commented 2 years ago

sorry, i have another idea try this bilalibrir_9.zip

bilalibrir commented 2 years ago

And one more stupid question: do you sure that all your matrices has the same data pattern? it is not a stupid question, everything is possible, but they are all the the same model number and the same pcb and the same manufacturing date. i already tested them with a U62_plus module they work fine. with you code they work fine too, in the horizontal configuration. perfactly soo..?? I really appreciate all the work and time you put in. so thank you very much. i will try the new code in secondes .

bilalibrir commented 2 years ago

ohhhh yes baby hhhhhh very very very close. i will make a video give me a minute very close

bilalibrir commented 2 years ago

2 x 2 configuration.

https://user-images.githubusercontent.com/86444589/153300118-19446ec0-988e-44a0-a2ef-478ee4632761.mp4

board707 commented 2 years ago

not so close as i hoped.... may be llower left panel is out of power? ^) Thank you very much i will look for some other way to solve this problem

bilalibrir commented 2 years ago

hello @board707 , i hope you are doing okay. do you have any new ideas you want to try? thank you.

board707 commented 2 years ago

Hello Thanks but there will be no tests today. May be tomorrow. Probably I misunderstand the scheme of panels with a complex pattern...

bilalibrir commented 2 years ago

Thank you for all, and tomorrow is the weekend here so i will be free all the day. Take care of your self, and have a lovely evening.

bilalibrir commented 2 years ago

good morning @board707 i hope you are doing well, i did some modification on the last code (v9), i think that is working perfectly, i did test it for 1by2, 1by3 and 1by4 configuration , it works fine and this is the code:

` if ((y >= this->DMD_PIXELS_DOWN) and 1) { //x_0 = (this->WIDTH - 32) (y / this->DMD_PIXELS_DOWN); // this shifted is back by 32 pixel //x_0 = (this->WIDTH - 64) (y / this->DMD_PIXELS_DOWN); // you will get a 0 all the time 0/x=0 x_0 = (y / this->DMD_PIXELS_DOWN); //x_0 = x_0 - 1; x_0 = x_0 - ((((y/16)+1)*2)/2)+1; // this add's 1 or 2 or 4 or 8 .... shift dipanding of the panel y level. y_0 = y - y % this->DMD_PIXELS_DOWN; x += x_0; y -= y_0; }

    //if (x_0 != 0 ) {   // i had to modifie this too .
    if ((x_0 != 0 )or 1) {
        x -= x_0;
        y += y_0;
    }

` i don't know how but it works, do you see or understand the logic of this and how you can improve the code, you are the math genius after all thanks for your time and help.

bilalibrir commented 2 years ago

https://user-images.githubusercontent.com/86444589/153582188-98ab3a04-98ee-42c5-9398-2bbe90df1b59.mp4

thank you soo much.

board707 commented 2 years ago

Thank you very much I will read your solution carefully

board707 commented 2 years ago

Hi, please test this. I don't think it will work, but I need to see the picture on 2x2 bilalibrir_a1.zip

bilalibrir commented 2 years ago

this is the finel code that works for all configuration tested ( 1by1 to 1by4), and (2by1 to 4by1) and 2by2. all tested.

`protected: void transform_XY(int16_t& x, int16_t& y) override { // coordinate conversion for 4s

// first run base transform
    DMD::transform_XY(x, y);
    int16_t x_0 = 0;
    int16_t y_0 = 0;
    int16_t eff_width = this->DisplaysTotal * this->DMD_PIXELS_ACROSS;
        x_0 =  (y / this->DMD_PIXELS_DOWN) - ((((y/16)+1)*2)/2)+1 ;
        y_0 = y - y % this->DMD_PIXELS_DOWN;
        x += x_0;
        y -= y_0;

    uint8_t y_shift = 0;
    if (y >= this->pol_displ) {
        y = y % this->pol_displ;
        y_shift = this->pol_displ;
    }
    int16_t x_t = (((x / 8) * 2) % (eff_width / 8)) * 8;

    if (y < this->nRows) {
        y = 2 * y + x / (eff_width / 2) + y_shift;
        x = x_t + (7 - x % 8);
    }
    else {
        y = 2 * (y - this->nRows) + x / (eff_width / 2) + y_shift;
        x = x_t + 8 + x % 8;
    }
        x -= x_0;
        y += y_0;
}

`

bilalibrir commented 2 years ago

i just tested the last code works fine for 1by4 and 2by2, its perfect

board707 commented 2 years ago

Thank you so much for your time! Yesterday I wrote a simple matrix emulator on my computer and I also see that the last code should work correctly. The reason, as you said, was a bug in the library. Thanks again, without you I would never find this bug I'm impressed that you managed to find a solution even for the code with an error.

In the last test, the bug has already been fixed, you can use this file safely. I will add this fix to the release in the next version. Best regards, Dmitry

bilalibrir commented 2 years ago

you are welcome, but all credit goes to you. so thanks again for your time and help. It's very appreciated. I enjoyed all the tests, feel free to contact me if you need to test new codes. I have noticed a ghosting effect and is a bit hard to show on camera. you can only see it at the D line. it could be the mux!!

https://user-images.githubusercontent.com/86444589/153635157-5d90bf25-e2be-4f19-87cf-0a559a623962.mp4

i really like this library and looking forward to test the next releases. thank you.

board707 commented 2 years ago

Ghosting can be caused by slow register response, a slight delay may be needed. I think it's better to make it separate issue.

If you have any comments on the library - you are welcome. I am always grateful for pointing out errors and bugs.

bilalibrir commented 2 years ago

thank you for your help, problem Solved. regards, Bilal