Hi John, I am posting a working snippet for moving a stepper controlled by an optical encoder. The encoder is fed to Timer1 which act as a 16 bits counter and using DT interrupt on overflow it will stop the motor when position is reached. I have commented the code but if something is not clear please just ask!.
Hope you will find the code usefull as a base to start building your own.
Cheers
Al.
Bookmarks