vpad/sample

Location

$CAFE_ROOT/system/src/demo/drc/vpad

Description

This sample program verifies the VPAD library's functionality. Use it to display any value that is possible to obtain from the library, and you can edit all modifiable values.

Screen Display

GYRO PRAMS Parameters that are modifiable using the VPAD library. The following items can be edited: Zero-Point Tolerance, Zero-Point Drift Correction, Attitude Correction, Acceleration Correction. The state of each item is also displayed.
VPAD DEMO MAN Information on how to operate the sample demo.
ACC The VPADStatus structure's acc information, given as a vector expressing the XY dimensions and a vector expressing the ZY dimensions.
GYRO The gyro value in the VPADStatus structure. The angular velocity for each axis is displayed below as pitch, yaw, and roll vectors. Up is positive and down is negative.
ANGLE The angle value in the VPADStatus structure. The following angular data for each axis is displayed using circles for the pitch, yaw, and roll. The counterclockwise direction is positive.
DIR The dir value in the VPADStatus structure. A block is displayed to the side, rotated according to the attitude data.

DRC Display

The touch points are displayed on the DRC display and each touch point is calibrated using the default calibration parameter.
If the displayed coordinates have errors, implement calibration procedure by using the VPADCalcTPCalibrationParam and VPADSetTPCalibrationParam functions.

Parameter Adjustment

The values can be edited using the digital buttons. Move the cursor with the +Control Pad. Use the A Button to either turn on or increment the selected digit. Use the B Button to either turn off or decrement the selected digit.

Resetting

Press the X Button to call the VPADSetGyroAngle and VPADSetGyroDirection functions and reset the DRC's angle and attitude data.

Rumble

Press the R Button to start the rumble feature. One press will make the VPAD rumble for one second. Press the ZR Button to stop the rumble feature.

Moving the Fulcrum of the Block

A block is initially displayed in the center of the screen. This shape is rotated based on the attitude data, using the fulcrum as the center point. The position of the fulcrum can be moved forward and back by three levels with the + Button and the - Button on the DRC.

Attitude correction using magnetometer

Press the Y Button to start the attitude correction using magnetometer.

Source Code Files

main.h
main.c
Contains the application startup and framework source.
sample.h
sample.c
Form the main body of the application that performs a variety of operations using the controller values. These application files initialize and load a DRC and contain the source code for the CPU processing and rendering that is performed in every frame.
graphic.h
graphic.c
The collection of subroutines for drawing simple graphics.
gfxutil.h
gfxutil.cpp
Contains the framework source for the DRC.

Revision History

2013-08-21 Added the description of the attitude correction using magnetometer.
2013-05-08 Automated cleanup pass.
2012-10-05 Updated old information.
2011-03-30 Initial version.


CONFIDENTIAL