How do I record button presses and play them back?

PaulS -

I will only use 6 keys to control the 3-axis machine.

I guess the time and sample rate could be adjusted or the machine slowed down if I need more accuracy. Do I need to define the time divisions for each bit of information, or is this automatically set? Can you refer me to an example of the code for this?

I would prefer to keep everything running under one ATMega328 without SD cards.