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

Scrolling on each matrix rather than as a set #3

Open
sej7278 opened this issue Jan 8, 2016 · 8 comments
Open

Scrolling on each matrix rather than as a set #3

sej7278 opened this issue Jan 8, 2016 · 8 comments

Comments

@sej7278
Copy link

sej7278 commented Jan 8, 2016

I've tried the AnimateText.ino and the example in README.md and they both do the same thing - the entire text scrolls on each matrix, rather than scrolling across 4 matrices.

So I end up with Demo...Demo...Demo...Demo

rather than D...e...m...o

Any ideas?

Using NodeMCU v1.0 (Amica and Doit.am) and a Wifi-Witty, Arduino 1.6.6 and 1.6.7

@benalb
Copy link

benalb commented Jun 23, 2016

¿Have you changed "#define NUMBER_OF_DEVICES 1"?

@ozett
Copy link

ozett commented Aug 18, 2016

with me its the same...
the entire text scrolls on each matrix, rather than scrolling across 4 matrices.
how to change? code improvement?

matrix

@dotsam
Copy link

dotsam commented Sep 2, 2016

Turns out this is the same issue I just commented on in #7, where with these boards with 4 modules, they're aligned 90º off, so the scrolling effect doesn't work right. We need something like the "vertical" parameter from this python library https://github.com/rm-hull/max7219

@ozett
Copy link

ozett commented Sep 2, 2016

yes, seems you are right.
i did a test with python. it worked there
rm-hull/luma.led_matrix#28

but it would be wonderfull, it it would work with this lib here and the ESP8266.. 😄

@marcelstoer
Copy link
Contributor

Yep, as explained in http://frightanic.com/iot/max7219-library-nodemcu-making/ (my site) you want that rotate option for the 4-in-1 modules and also an invert (upside down) option if you daisy-chain manually.

@adityarao
Copy link

adityarao commented Sep 18, 2017

Team, if fixed this for 1x4 module mentioned above @ozett and @marcelstoer The modified changes are here: https://github.com/adityarao/MAX7219LedMatrix/

The only change required was to rotate the matrix as below in the LedMatrix::commit() as below:

void LedMatrix::commit() {
    byte index = B0000001;
    byte col; 

    if(deviceOrientation == HORIZONTAL) {
        for (col = 0; col < myNumberOfDevices * 8; col++) {
            sendByte(col / 8, col % 8 + 1, cols[col]); 
        }
    } else if(deviceOrientation == VERTICAL){ // orient the device vertically
        for (col = 0; col < myNumberOfDevices * 8; col++) {
            xcols[col] = 0; 
        }
        // little inefficient, can be enhanced, rotate the matrix !
        for (col = 0; col < myNumberOfDevices * 8; col++) {

            for(byte bits = 0; bits < 8; bits++) 
              xcols[col] |= ((cols[bits + 8*(col/8)] & (index << (col%8))) ?
                                     (B10000000 >> bits) : 0);  
            sendByte(col / 8, col % 8 + 1, xcols[col]);
        }
    }
}

@adityarao
Copy link

img_20170918_202009

@witnessmenow
Copy link

@adityarao nice solution!

I'll update my PR with this solution as it uses less memory

flntzr added a commit to flntzr/smart-bike-helmet that referenced this issue Apr 25, 2019
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

No branches or pull requests

7 participants