I made a dot matrix that contain 10 row and 12 column , total 120 led.
I want to turn on the leds like this picture but when I open ground 1 , 2 and pin 0 , 1 , 2
6 leds light together.what kind of structure should I build?
Sheme : enter image description here
I tried row by row like this:
clear_cube();
regWrite(cube[0][0], HIGH);
set_array(4);
//delay(10);
clear_cube();
regWrite(cube[1][0], HIGH);
set_array(3);
//delay(10);
clear_cube();
regWrite(cube[0][0], HIGH);
set_array(2);
//delay(10); When I decrease the delay 5 leds blinking.
100 50 10 0 delay Youtube
2 Answers 2
You can't just turn them on like that.
Instead you have to turn one row on. Then the next row. Then the next. Very fast.
So you first display:
O@OO
OOOO
OOOO
Then you display
OOOO
OO@O
OOOO
Then you display
OOOO
OOOO
O@OO
And you cycle through that very fast. Usually using a timer to run it all. The fact that you're using '595s will slow you down and make it harder to update fast enough to look non-flickery.
-
-
I tried but it does not work .I update the code like above @Majenko♦johnny003– johnny0032020年07月25日 14:50:37 +00:00Commented Jul 25, 2020 at 14:50
-
1That code is completely meaningless.Majenko– Majenko2020年07月25日 15:29:49 +00:00Commented Jul 25, 2020 at 15:29
-
No. regWrite turn on the positive and set array turning on the ground.I'm uploading a video 100 50 10 and 0 delayjohnny003– johnny0032020年07月25日 15:44:42 +00:00Commented Jul 25, 2020 at 15:44
-
That looks like it's working. But like i said, your use of '595s will make it hard to make it non-flickery. You need to refresh very fast. Ideally hundreds of times per second, though tens of times per second will be tolerable.Majenko– Majenko2020年07月25日 16:04:02 +00:00Commented Jul 25, 2020 at 16:04
You want to multiplex them by rows or columns. If you do it by columns, then do the following: Set all columns to open circuit. (everything off.)
Set the row value pins for the first column, then activate the column pin for the first column. The LEDs for the first column light up.
Now delay for a brief period (say 20 ms) and go on to the next column. (Obviously you'd use a loop for this.) Repeat.
You should write your code as a state machine using millis()
rather than using delay, or you will paint yourself into a corner and you'll write code that totally blocks the machine just to display the LED grid. If you use millis()
and a sate machine you'll be able to do other things at the same time you loop through the LEDs
Explore related questions
See similar questions with these tags.