Welcome! Log In Create A New Profile

Advanced

Guitar Hero Controller Analog Stick

Posted by Shadow1643 
Guitar Hero Controller Analog Stick
October 25, 2008 10:27PM
Anyone know how to read the data from the Guitar Hero controller's analog stick? (C++)



Edited 1 time(s). Last edit at 10/25/2008 10:27PM by Shadow1643.
Re: Guitar Hero Controller Analog Stick
October 25, 2008 11:24PM
Wpad.h should have something for it.
Re: Guitar Hero Controller Analog Stick
October 26, 2008 04:41PM
WPAD.h doesn't really give any info like that.

I know that you read the nunchuk by:

               struct expansion_t data;
               WPAD_Expansion(WPAD_CHAN_0, &data);

		if (data.type == WPAD_EXP_NUNCHUK) {
			vec2b_t center = data.nunchuk.js.center;
			printf("\x1b[2;0HNunchuk X: %d     \n Nunchuk Y: %d     \n", data.nunchuk.js.pos.x - center.x, data.nunchuk.js.pos.y - center.y);
		}

Would the code be pretty much the same except for something like "data.guitar.js.pos.y"? (Which doesn't work)
Re: Guitar Hero Controller Analog Stick
October 28, 2008 03:09PM
In case you haven't found the answer yourself by now, It should work if you use "data.gh3" instead of "data.nunchuk". And don't forget to replace WPAD_EXP_NUNCHUK with WPAD_EXP_GUITARHERO3. Unfortunately I can't test it, since I don't have a Guitar Controller, but this should work.

struct expansion_t data;
WPAD_Expansion(WPAD_CHAN_0, &data);

if ( data.type == WPAD_EXP_GUITARHERO3 )
{
	vec2b_t center = data.gh3.js.center;
	printf("\x1b[2;0HGuitar X: %d     \n Guitar Y: %d     \n", data.gh3.js.pos.x - center.x, data.gh3.js.pos.y - center.y);
}
Re: Guitar Hero Controller Analog Stick
October 31, 2008 12:03AM
Thank you for the answer! Of all the things I tried, I didn't try data.gh3... <_<
Sorry, only registered users may post in this forum.

Click here to login