Pages: [1]   Go Down
Author Topic: Updated Wii Classic Controller Library  (Read 601 times)
0 Members and 1 Guest are viewing this topic.
Queens, New York
Offline Offline
Faraday Member
**
Karma: 106
Posts: 3760
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello all, as the title says, I have updated the Wii controller library, but since I am not the original creator of the library in the playground, I had to make my own.

If you have used the previous library with the new IDE, then you would have noticed a few things were not quite correct.
For instance, if you press RB (right bumper), it would show :

Please note nothing here was altered or tampered with, this is straight from the output of the example sketch.
Quote
Buttons:LS.RS.RD.DD.select.home.start.
right shoulder: 31
 left shoulder: 0
 left stick x: 14
 left stick y: 14
 right stick x: 26
 right stick y: 30

And if you press the A button, it would show:
Quote
Buttons:lz.y.a.b.
right shoulder: 14
 left shoulder: 1
 left stick x: 14
 left stick y: 14
 right stick x: 26
 right stick y: 30

Pressing ZR will show:
Quote
Buttons:lz.rz.x.y.a.b.
right shoulder: 14
 left shoulder: 1
 left stick x: 14
 left stick y: 14
 right stick x: 26
 right stick y: 30

And same goes for SELECT, START and digital UP and LEFT.

Also notice the stick values, 14 as a midpoint for left stick and 26 for right stickX and 30 for right stickY.
I dont know about you, but these are not the usual values I would expect to see for the midpoint of a potentiometer. I am used to seeing 127 or 128 (byte range, not int) for a midpoint, not 14, 26 or 30.

My library is very similar to the previous library but I got all the bugs out and everything works the way it should.
There is one thing that looks incorrect, and that the stick values. The raw data values go from 0x00 to 0x1F or 0 - 31, what I did was multiply that raw data by 8 to give a better range, BUT the highest value is 248 instead of 256. (31 * 8 = 248)

Let me know what you think.

Edit: Library is now added to the playground

Look at last post for updated Library
« Last Edit: August 28, 2014, 12:21:45 pm by HazardsMind » Logged

Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Queens, New York
Offline Offline
Faraday Member
**
Karma: 106
Posts: 3760
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Minor update to the library.

Version 1.01:
  Fixed button defines for X, Y, A and B.
  They were causing errors with my other sketches and libraries.

* WiiClassicController.zip (2.98 KB - downloaded 15 times.)
Logged

Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Queens, New York
Offline Offline
Faraday Member
**
Karma: 106
Posts: 3760
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Another minor update.

Version 1.02:
  Added two new functions:

    SetLeftStick_Factors(byte, byte)
    SetRightStick_Factors(byte, byte)

    These multiply the returned values from the joysticks. 1: Lowest(0 - 31 range) to 8: Highest(0 - 248 range)

Sudo example:
Quote
SetLeftStick_Factors(1, 8 ); // X_axis, Y_axis

. . .

leftStickX() returns a range between (0 - 31)    // smooth
leftStickY() returns a range between (0 - 248) // choppy

* WiiClassicController.zip (3.24 KB - downloaded 5 times.)
« Last Edit: August 27, 2014, 10:16:28 am by HazardsMind » Logged

Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Pages: [1]   Go Up
Jump to: