Honestly, I never approach a project like that without building test sketches to actually implement the basic functions. Then questions like the ones you are asking, are phenomenally easier to solve. It's because they become specific problems, not general ones.