People can be so great. Have you heard about bildr.org? You should visit this great blog if you find arduino interesting.
Researching optical encoder, arduino and stepper, I came across bildr's tutorial "Rotary Encoders and Arduino". I figured out some things thanks to that post, and was left with some new - more refined - questions. I happily posted my questions there, specifically wondering if there is a way to create a modified "knob sketch" using a stepper and an optical. Soon enough I was answered by Adam, who happens to be the founder of bildr, saying that this seems like an interesting query, and that my project seems interesting enough and well --- "awesome" -- so he'd gladly help. Is this great and awesome, or what? e mail correspondence ensued and I was delighted to learn of a library called AccelStepper that helped me get to the desired goal, as is visible in the video.
The code is fairly simple once you understand that steppers are so much different than servos. I admit I had to check, recheck, ask, research until I finally figured what the hell was going on there. But that's what friends are for, right? :)
I'm posting the code and finishing this with 3 important notes:
1. I had to push up the baud rate or else Serial.print delayed the hell out of the motor. Serial.print will be replaced with Serial.write for the Xbee, and so had to be checked early on.
2. Check out the void updateEncoder() function. This is the first time I understood what all the "bitwise operators" talk actually means, and I find it simply beautiful...
3. I will now proceed with the implementation of the various modes for the follow focus. I suspect I'll have some issues and problems along the way, but otherwise there would be no sense of accomplishment, right?