Welcome! Log In Create A New Profile

Advanced

How do I use the nunchaku with wiiuse/wpad?

Posted by Cypri 
How do I use the nunchaku with wiiuse/wpad?
March 21, 2011 03:55AM
How exactly would I go about doing this? I'm just getting back into wiibrewing, so I'm kinda scratching my head at this. I can use the wiimote just fine, but I cant figure the nunchaku out.
Re: How do I use the nunchaku with wiiuse/wpad?
March 21, 2011 03:37PM
there should be a tutorial somewhere or its in the source of published application but its roughtly this;

static WPADData *wd[4];  //ir
struct expansion_t data; //nunchuk

while render loop {
		
		wd[0]= WPAD_Data(0); //ir		
		WPAD_Expansion( 0, &data ); //nunchuk

	//CHECK BUTTONS
		if (data.type == WPAD_EXP_NUNCHUK) {
				m_x= (20.0 * (data.nunchuk.js.pos.x - data.nunchuk.js.center.x )) / data.nunchuk.js.max.x;
				m_y= (20.0 * (data.nunchuk.js.pos.y - data.nunchuk.js.center.y )) / data.nunchuk.js.max.y;
				//move_left=( m_x < -1 );  move_right=( m_x > 1 );
				//move_up=( m_y > 1 );  move_down=( m_y < -1 );
		}

}

that should work
Sorry, only registered users may post in this forum.

Click here to login