Welcome! Log In Create A New Profile

Advanced

Getting the number of attached controlers?

Posted by WiiPhlex 
Getting the number of attached controlers?
August 15, 2008 09:51AM
Is there a function that gets the number of initialized attached controlers?
Re: Getting the number of attached controlers?
August 15, 2008 10:51AM
Try to get it by analysing the accel-values... it never happens that if a wiimote is holded in the hand, the values are steady for a whole second, no, 2/50 of a second.

I know it because I logged the movements of a wiimote on my pc with a break of 20 Ms between each check. (wiimotelib .net)
Re: Getting the number of attached controlers?
August 15, 2008 11:28PM
I believe that you can check each individual controller. Perhaps you could right a function that performs all of those checks and then returns 4 values (via reference obviously). One for initialized wiimotes, the next for nunchucks, then for classics, and finally for gamecubes.
Re: Getting the number of attached controlers?
August 18, 2008 08:46AM
You can also pas it by a int[4].
Re: Getting the number of attached controlers?
August 18, 2008 08:53AM
Been trying a few things, not much has worked effectively yet, I'll keep you update when I work on it again.
Re: Getting the number of attached controlers?
August 19, 2008 07:43AM
You can probe the wii controllers and count the ones that return an attached controller.

E.g.

int number_of_attached_controllers() {
  int i, num_attached=0;
  u32 type;  //expansion type, not used in this example

  for(i=0; i<WPAD_MAX_WIIMOTES; i++) {
    if (WPAD_Probe(i, &type) == WPAD_ERR_NONE) {
      num_attached++;
    }
  }
  return num_attached;
}
Re: Getting the number of attached controlers?
August 19, 2008 02:38PM
Never mind...



Edited 1 time(s). Last edit at 08/19/2008 02:39PM by Dykam.
Sorry, only registered users may post in this forum.

Click here to login