0

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

asked Jul 25, 2020 at 13:42

2 Answers 2

1

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.

answered Jul 25, 2020 at 13:45
5
  • I will try that Commented Jul 25, 2020 at 13:53
  • I tried but it does not work .I update the code like above @Majenko♦ Commented Jul 25, 2020 at 14:50
  • 1
    That code is completely meaningless. Commented 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 delay Commented 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. Commented Jul 25, 2020 at 16:04
0

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

answered Jul 25, 2020 at 19:23

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.