MajicDesigns / MD_MAX72XX

LED Matrix Library
GNU Lesser General Public License v2.1
307 stars 122 forks source link

Map physical position to buffer index #41

Closed abaskin closed 3 years ago

abaskin commented 3 years ago

Add the ability to map the physical location of the devices to the buffer index.

I have a display module that is constructed with the data in on the lefthand side and is wired in such a way that the individual devices are numbered 3 2 1 0 by the library. This makes it difficult to write to the display. This change adds a device map array allowing the physical location of the devices to be mapped to the buffer indexes.

MajicDesigns commented 3 years ago

Can you explain why the IN side is on the left and cannot be changed to the right? It is clear from the library documentation that the IN side should be on the right and I am curious to understand why this is not possible.

Also, what level of testing have you done for this? Does the test sketch still behave as normal?

It looks to me like this change would actually break the entire library when you are specifying the type of device and you decide to change the order of the modules (ie, reverse them).

abaskin commented 3 years ago

The module is constructed of four MAX7219 chips with attached matrix displays. On the left side the data in pin of the module is connected to the data in pin on the MAX7219 and on the right side the data out pin of the module is connected to the data out pin on the MAX7219. However, upon further reflection, I realized that if I flipped the module around so the data in is on the right and changed the type from MD_MAX72XX::DR1CR1RR1_HW to MD_MAX72XX::DR1CR0RR0_HW this solved the issue as well. The only downside being that the printed labels on the module are now upside down. I don't think this change makes sense for my original use case so maybe it is best to not implement it unless someone else can come up with another use case.

I've run through the example programs with the change and the module I have and all appear to work properly.

On Fri, Dec 25, 2020 at 1:20 PM Marco Colli notifications@github.com wrote:

Can you explain why the IN side is on the left and cannot be changed to the right? It is clear from the library documentation that the IN side should be on the right and I am curious to understand why this is not possible.

Also, what level of testing have you done for this? Does the test sketch still behave as normal?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MajicDesigns/MD_MAX72XX/pull/41#issuecomment-751183941, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEQZQY44FFEWEGCSUIENZTSWQVKPANCNFSM4VIXJA6Q .

MajicDesigns commented 3 years ago

Ok. You should find that the 4 joined up modules are FC16.