checking machine using arduino and old printer help in movement

im making a bubble sheet checking machine using scrap printer need help in coding the movement.

i used ardunio uno and h-bridge l298 and also a printer rotary encoder.

it will feed the paper like normal printer because i just remove the cartrage and replace it with an line sensor to detect the black any suggestion for the movement im getting a hard time to find a correct code to finish this project?

sketch_jan19a.ino (6.63 KB)

need help in coding the movement.

The movement of what? Moving how?

movement like an cnc movement but using the rotary encoder of the printer for precision

When you have some real requirements, come on back. Meanwhile, hand-waving can not be implemented in code.

You need to explain what exactly you have tried and the results you got.

A clear diagram of the machine so we can understand what you are talking about and a clear wiring diagram would also help.