int main(void)
{
SceCtrlData pad;
pspDebugScreenInit();
SetupCallbacks();
sceCtrlSetSamplingCycle(0);
sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
while(!done){
pspDebugScreenSetXY(0, 2);
sceCtrlReadBufferPositive(&pad, 1);
printf("Analog X = %d ", pad.Lx);
printf("Analog Y = %d \n", pad.Ly);
if ((pad.Lx>=127)&&(pad.Ly<30))
{
printf(" Go East \n");
}else if ((pad.Ly<= -127)&&(pad.Lx<30))
{
printf(" Go West \n");
}else if ((pad.Ly<= -127)&&(pad.Lx<30))
{
printf(" Go North \n");
}else if ((pad.Lx>=127)&&(pad.Ly<120))
{
printf(" Go South \n");
}
}
sceKernelExitGame();
return 0;
}
leenoi: the result in aStickR is a value from 0 to 15 (16 different values) depending on the direction you pull the stick in. if it's -1, it means that it's not pulled in any direction (relatively) depending on the threshold value (4500).
if you change the 16.0f in the code to 8.0f then you get 8 different values (0..7).
Saotome wrote:dot_blank: thanks for the extra points :)
leenoi: the result in aStickR is a value from 0 to 15 (16 different values) depending on the direction you pull the stick in. if it's -1, it means that it's not pulled in any direction (relatively) depending on the threshold value (4500).
if you change the 16.0f in the code to 8.0f then you get 8 different values (0..7).