Joystick for pan/tilt camera control

Probably not exactly what you need, but the idea itself can be helpful. Materials in Polish but there are lots of drawings and full source code: