I recently did a small consulting gig and built a one-off robot for a customer. The gig included the hardware but also the client needed some example code to get himself up and running a bit quicker. This turned out to be a great oportunity for me to sit down and clean-up some code that I have been using for years, in this case, my pan and tilt code...
I took the liberty of tiding up and commenting this code as well as removing all the "scraps" so it would be a nice, clean, "cut-and-paste" chunk of code. I thought it would be nice to offer it to everyone --It does work pretty darn well, actually.
Enclosed in this post is a video walk through of the code as well as a zip of the code itself.