MAX7219 Adding Special patterns to scrolling text code and adjust speed via POT

Hi dear community;

i have 4 x MAX7219 Module with Arduino Uno.

i was found some scrolling text examples for MAX7219 Module on internet, then i run it without any problem but i want to make 2 change on project.

This is the code what i run without any problem;

(Thus 9000 character limit of this post i cannot paste the code here as text)

1-) i added two 10k potentiometer to breadboard and added code to IDE to adjust scroll speed and brightness.
POT's are works but problem is; when you adjust the POT, scroll speed or brightness on the MAX7219 doesnt change until next loop.
İs there a way to adjust instantly ? so i dont have to wait untill next loop of code ?

This is my POT added code later on

And this is the video of what happening

2-) How to add specific pattern to char list ? e.g a Heart or Smile pattern.
I simply tired to modify one of the current byte array like; #
but i could not able to use 8x8 fully because byte array in this set seems 5x8 thus i cant fit the heart and simle to limited set.

any way to do this ?

Thanks in advance, Best regards.

Thus 9000 character limit of this post i cannot paste the code here as text

No but if you read the how to use this forum sticky post it will tell you how to attach it.

Depending on what else your invisible code is doing then a simple delay based on the pot value might help you achieve this. If not then you write your code as a state machine like the blink without delay example.

any way to do this ?

I am sure there is, however not being able to see your code is not helping home in on the fine details of your problem.

here the code as attach

MAX7219_POTLU_KAYAN_YAZI.ino (9.45 KB)

Thanks for that.
Is that the code that is working without any problem?

If so it is your unsuccessful attempt at change we need to see.
When you post it please say what it does and what you expect it to do.

Grumpy_Mike:
Is that the code that is working without any problem?

If so it is your unsuccessful attempt at change we need to see.
When you post it please say what it does and what you expect it to do.

Yes sir this is the final code which i run with POTs in this video https://youtu.be/wso0ny1WRPA

İs there a way to adjust instantly

Yes read the pot so that you set the speed with every update, not just at the start.

Grumpy_Mike:
Yes read the pot so that you set the speed with every update, not just at the start.

could'tn you explain on my code ? which part should i change with what ? im not expert like you. Explain it, just like explain to a stupid.

Explain it, just like explain to a stupid.

This is the line that sets the scroll speed variable.

scrollSpeed = map(analogRead(A1), 0, 1023, 0, 500); // speed of scrolling text, lower is faster

This is the line that sets the speed by delaying for a specific amount of time:-

delay(shift_speed);

So everywhere you see this line you put the line:-

scrollSpeed = map(analogRead(A1), 0, 1023, 0, 500); // speed of scrolling text, lower is faster

before it.

1 Like

@OP

Check if there is any immediate affect in the scrolling speed by doing --

1 Comment out the following lines in the loop() function.

//scrollSpeed = map(analogRead(A1), 0, 1023, 0, 500); 
//delay(100);
// clearLCD(maxInUse, scrollSpeed);

2. Modifying the following line in the 'printCharWithShift()' function as indicated.

delay(map(analogRead(A1), 0, 1023, 0, 500));//shift_speed);
1 Like

GolamMostafa:
@OP

Check if there is any immediate affect in the scrolling speed by doing --

1 Comment out the following lines in the loop() function.

//scrollSpeed = map(analogRead(A1), 0, 1023, 0, 500); 

//delay(100);
// clearLCD(maxInUse, scrollSpeed);




**2.** Modifying the following line in the 'printCharWithShift()' function as indicated. 


delay(map(analogRead(A1), 0, 1023, 0, 500));//shift_speed);

Yessss sir you made my day thanks for the help that solved my problem.

sorry for late reply i just return from work

Best regards

Grumpy_Mike:
This is the line that sets the scroll speed variable.

scrollSpeed = map(analogRead(A1), 0, 1023, 0, 500); // speed of scrolling text, lower is faster

This is the line that sets the speed by delaying for a specific amount of time:-

delay(shift_speed);

So everywhere you see this line you put the line:-

scrollSpeed = map(analogRead(A1), 0, 1023, 0, 500); // speed of scrolling text, lower is faster

before it.

Thank for the idea sir

1-) Problem solved Thanks you dear mentors for this great help.

Now how to do Problem 2-) ?

Please teach me.

Thanks in advance, best regards