[Game Pad Grabber PIC] Chapter 12.  Game Pad Grabbers


Back in chapter 4, I developed an example involving two multi-jointed arms with fingers (the grabbers). One drawback of the coding was the bewildering mix of key combinations needed to translate and rotate the arms.

This chapter connects a game pad to the grabbers, making them much easier to control, mainly because of the intuitive mapping of the grabbers operations to the pad's analog sticks, hat, and buttons. For example, the left stick controls the x- and y- axis rotations of the left arm, and the right stick handles the right arm.

Another advantage of using a game pad is that it becomes simpler for the code to process multiple inputs at the same time. For instance, the grabbers' base can rotate and move forward while the arms are turning. This is due to the use of polling, which collects information from multiple game pad components at once.

Other novel features of this example are:




Dr. Andrew Davison
E-mail: ad@fivedots.coe.psu.ac.th
Back to my home page