Interface logic with buttons and stepper motor instead of program flash

Is it possible?

In my hobby project, I've some functions that may do not need to run in loop continously in arduino MEGA2560.

If I press a button, it do automatic moves stepper motor one increment on the fly while the arduino running the program and the counter that counts how many steps the stepper motor have had moved in realtime; so, when it is necesary, MEGA2560 reads how many steps it has moved from the small count circuit. Therefore, it reduces the size in the main program in MEGA2560.

I wanting that the stepper motor moves precise all time in least 16 hours while I am playing the flight simulator; I do not want to calibrate often the home cockpit which include huge stepper motors.

The Arduino Mega 2560 board has 8kbyte sram and 256kbyte flash for code.
Using extra hardware to store a counter requires more code and more ram usage and more chance for bugs. It will not reduce the size of the program, it will increase the memory usage a lot.

Peter_n:
The Arduino Mega 2560 board has 8kbyte sram and 256kbyte flash for code.
Using extra hardware to store a counter requires more code and more ram usage and more chance for bugs. It will not reduce the size of the program, it will increase the memory usage a lot.

Hi Peter.

Thank you for the information.