Repeating pattern - Robotarm


Im currently working on a robotarm project. Using 3x L293D to control 5x DC motors. The plan is to make a robotarm where i can control it with a joystick and i want it to save the patterns.

Simply explained, after i click on a button it will start recording the pattern it does until i press a button for it to stop recording and repeat the pattern automaticly until i press a reset button to make it go to default position. And when i press reset button i also want it to wipe off the data it saved in the memory.

But since i am new to this i am stuck in the programming part, if there is anyone out there who would want to help/guide me i would be really happy :)

What i have done until now: -Built the velleman robotarm -Circuit -Tested the robotarm with some simple coding (moving the arm etc.). And it worked, tho when i run 2x motors at once it is kinda slow. I'm not sure if its cuz of my batteries..

here is the circuit:

PS: The batteries i use is D type batteries with 1.5x V on each, so 4x D batteries = 6 V.

And sorry for my poor english, its not my first language. Thank you!

What is your definition of a "pattern"? How often are you reading the joystick positions? How often do you apply the values to the motors? All at once, or as each joystick position is determined?