Welcome! Log In Create A New Profile

Advanced

Quick, easy controller question

Posted by seek 
Quick, easy controller question
February 20, 2010 03:36AM
Hello, I'm just starting out messing around with coding for the Wii. I've been looking at teknecal's great tutorials, and understand how to get input from one controller using
u16 var1 = PAD_ButtonsDown(0), etc.
I want to define a variable that checks if controller 2 is being pressed, so I tried,
u16 var2 = PAD_ButtonsDown(1),
but it seems the compiler doesn't like that.

So how would I define a variable similar to var1 but for the second controller?
Thanks for any help
Re: Quick, easy controller question
February 20, 2010 04:25AM
It's suppose to work, here are the names you should use for parameters in PAD_ButtonsDown:
#define PAD_CHAN0					0
#define PAD_CHAN1					1
#define PAD_CHAN2					2
#define PAD_CHAN3					3
What is the error message that the compiler is giving?
Re: Quick, easy controller question
February 20, 2010 06:05AM
Well, it's saying that my var2 is undeclared (first use in this function)
...do I need to define it at an earlier point? I tried and that didn't do anything
Re: Quick, easy controller question
February 20, 2010 06:07AM
Wow, just...wow... I misspelled a variable. That's why it's undeclared later on. Please ignore

Thank you for your help though :)
Sorry, only registered users may post in this forum.

Click here to login