This sample program verifies KPAD library functionality. Using it, you can display onscreen any value that is possible to obtain from the library, and you can edit any value it is possible to modify in the library.
|POINTING||The scaling value used for determining the on-screen position; it is the factor by which you multiply the pos member variable of the
|POS HOR DIS ACC - PLAY SENS MODE||Shows the play radius (
|RPT - DLAY PLUS||Indicates the repeat start time (
|HLD||Displays the binary value of the flag set when a digital button is held down (
|TRG||Displays the binary value of the flag set when a digital button is pressed (
|REL||Displays the binary value of the flag set when a digital button is released (
|VALID||Indicates the dpd_valid_fg value of the
|DIST||Indicates the dist value of the
|OBJ||Indicates the position of the object captured by the DPD. The rectangle is the sensor range.|
|DPDCB||It will be displayed together with the reason value when a callback registered with
|AIM||Displays the aiming mode.|
|CIRCLE CLAMP / CROSS CLAMP||Displays the stick clamp mode.|
|SMP.RATE||Displays how many registered callbacks of the
The values can be edited using the digital buttons. Use the +Control Pad to move the cursor; A Button to increment the
value for that digit or to change
KPAD_PLAY_MODE_TIGHT; and B Button to decrement it or change
Calibration is required if the Sensor Bar is not level or if the accelerometer returns values that are off by a large amount. One example of this is when the Wii remote is held in a horizontal position but the acceleration sensor returns values that differ considerably from those of a horizontal position. The calibration process corrects the value of the
KPADStatus structure's horizon member variable; the acc member variable is not affected.
To activate calibration, press the - Button. Be sure that the controller is in a horizontal position and that only two sensors are detected. If one or three sensors are detected, calibration will fail. If calibration succeeds, CALIBRATE is displayed on the screen; if calibration fails, ERROR is displayed.
When the Nunchuk controller's Control Stick is moved, the movement is displayed on the TV screen as an orange, dashed-line arrow.
The kpadsample demo supports the Classic Controller. When a Classic Controller is connected to a Wii remote, the state of the digital buttons (pressed/not pressed) and analog trigger on the Classic Controller are displayed in the lower part of the TV screen. Movements of the Classic Controller L Stick and R Stick are displayed on the screen using green arrows.
Press the 1 Button on the Wii remote to turn the DPD ON and press the 2 Button to turn it OFF.
Allows the switching of clamp mode of the Nunchuk or Classic Controller stick. The clamp mode is configured using the
This is switched every time a C Button on the Nunchuk Unit or the -/SELECT Button on the Classic Controller is pressed.
This is also switched while the Z Button on the Nunchuk or the +/SELECT on the Classic Controller is pressed.
Pressing the Z Button on the Nintendo GameCube controller connected to 1P calls the
KPADSetButtonProcMode function and changes the button-processing method. In the
kpadsample demo, cursor movements use the button trigger information in the starting element of the sample buffer of the
KPADReadEx function. Note that when the button processing method is
KPAD_BUTTON_PROC_MODE_TIGHT, there will be times when the cursor does not move even if the button is pressed because there is no button trigger information in the starting element of the sampling buffer.
Miscellaneous tests may be performed by connecting a Nintendo GameCube Controller to 1P.
KPADReadExfunction will not be called from the main loop of the program.
KPADSetReviseModefunction; it will also turn ON or OFF the corrective processing that switches the position at which the Nunchuk motion sensor returns a horizontal value.
KPADShutdownfunctions, starting and stopping the KPAD library.
KPADSetButtonProcModefunction and changes the button-processing method.
||Contains the application startup and framework source.|
||This application performs a variety of operations with the controller values. These application files initialize and load controllers and contain the source code for the CPU processing and rendering that is performed every frame.|
||The collection of subroutines for simple graphics drawing.|
2013/05/08 Automated cleanup pass.