User manual
MPLAB Starter Kit for PIC18F User’s Guide
DS51852A-page 12 © 2009 Microchip Technology Inc.
2.3 USB HID JOYSTICK DEMO
This demo uses the starter kit as a USB joystick.
To test the joystick feature, open the Game Controller applet in the Control Panel. In
the following dialog, select “Joystick Demo” under “Installed Game Controllers”, then
click Properties. At the “Joystick Demo properties” dialog, select the Test tab to show
the interactive test display (Figure 2-4).
FIGURE 2-4: JOYSTICK DEMO PROPERTIES DIALOG
The following controls are implemented in the Joystick Demo:
1. X-Axis/Y-Axis: The movement of the cursor around the white area is controlled
using the on-board accelerometer. Like the Mouse Demo, acceleration on all
three axes is used to compute board tilt, which is then converted to movement
on the X and Y axis. While holding the starter kit board so that the USB connector
faces towards you, tilt the board to the right and left to change the X-axis position.
Tilt the board up and down to change the Y-axis position.
2. Z-Axis: The Z-axis is controlled using the scroll bar. Touch the bar and slide your
finger towards the bottom or top to change the Z-axis position.
3. Z-Rotation: Rotation around the Z-axis is controlled with the potentiometer.
Rotate the potentiometer to change the rotation.
4. Buttons 1 and 2: Of the 13 buttons displayed, buttons 1 and 2 are controlled
using the L and R touch pads, respectively. Press and hold the pad to turn on
(light up) the corresponding joystick indicator.