I am working on a program for Arduino that sends data to some shift registers to control a large dot-matrix display. I need the text to scroll, and this is where I run into problems. Let’s say for example that the display is showing “HI”. The first set of data along the entire screen would be “10001 11111”. This will represent the columns that are lit in the first phase. If I put that together and add a space I get “10001011111” I have figured out that a number in binary can be shifted one column by dividing it by 2.
So for example “11111” / 2 = 01111. The next division is 00111, then 00011, and 00001, etc. The problem is that I am passing the data to two separate shift registers, one for each digit. So first I send “11111”, and then I shift in “10001”. When they are scrolling the data needs to transfer from one display to another. Below is a chart to try to make more sense of this:
For the work “HI”
BAD
H | I
10001 0 11111
01000 0 01111
00100 0 00111
00010 0 00011
00001 0 00001
00000 0 00000
What I need
H | I
10001 0 11111
01000 1 01111
00100 0 10111
00010 0 01011
00001 0 00101
00000 1 00010
00000 0 10001
00000 0 01000
00000 0 00100
00000 0 00010
00000 0 00001
00000 0 00000
I have really tried everything I can think of. What is the solution?
If your line will fit inside the space you have available to store the data, can’t you just put the entire line there and shift it? Rather than using a fixed central divider space, encode your message not as individual letters but just as the matrix you are trying to display.
then repeatedly divide by 2.
Do the same thing on all the other lines, I bet the 2nd one will be
10001000100and the right-shift divide by 2 works just the same.