Wii Classic Controller + Arduino Pro Micro = WiiClassicControl.h Error?

Hi guys, posting for the first time here!

I have a Wii classic controller + Arduino Pro Micro and its ok, well it works partially.
My windows reconizes the arduino like a joystick driver, and i can use it, but theres a bug when i press some buttons, if ai press button A, its mark pressed A + Y, if i press UP its marked UP + ZR + Y, I attach a picture.

I got from here: Updated Wii Classic Controller Library - Libraries - Arduino Forum the WiiClassicControl.h.

If anyone has experienced this please let me know.

Thank you guys

photo_2016-10-01_18-16-13.jpg

WiiClassicControl.h (4.13 KB)

Its been a long time since I did anything with that library, what IDE version are you using? I don't currently own a Pro Micro, but I will try to get one in and see if I can recreate this bug.

HazardsMind:
Its been a long time since I did anything with that library, what IDE version are you using? I don't currently own a Pro Micro, but I will try to get one in and see if I can recreate this bug.

Hi

yeah i got your file, very thank you for share!
I'm using IDE 1.6.11.

And after download your file i search more and found a fix for your file, because only stickers work.
I change this:


private:

boolean GetButton(byte col, byte D)
{
return ((data[col] & D) == 0); <-- Here, this line.
}

int GetStick(byte col, byte mask)
{
return (data[col] & mask);
}


After this little change all works, but with this bug if i press some buttons, its shows duplicates, like the picture.

i'll take a look and see what is wrong.

Updated the library, download it from my Github Repo.

Let me know if this fixes the issue you are getting, if not then you will need to wait until the Pro Micro I just ordered comes in.

Thank you man for your time man!
Its fix the problem with buttons and stickers now all works, but my other problem persists when i press UP its show ZR + Left + Up + X.

I upload a new picture.

I have another files that work, but its only work for "Monitor Serial", and i need upgrade all the code for use with Joystick.h. With this joystick.h i can convert the arduino in a joystck drive for windows.

Im uploading this too.

Btw, my adruino pro micro is 5v, Im using 5v in my classic wii controller, but i think its not the problem.
But one more time, thank you man!

WiiClassic.h (4.99 KB)

teste_wii.ino.ino (2.66 KB)

You probably should not be powering the controller on 5v as it is intended for 3.3v.

If your board does not supply 3.3v then you can use either 2.2k and 4.7k OR 220 ohm and 470ohm resistors, but don't mix and match them like (2.2k and 470) this will not work.

Something like the image below?

Yes.

What are you using to power your arduino?

HazardsMind:
Yes.

What are you using to power your arduino?

Nothing external, just the usb cable from PC. But theres 5v in VCC i checked it.
Thank you man, i will try this with resistors.

i got external power 3.3v for my wii classic joystick, but the bug still remains.

Did you remember to connect the ground from the external 3.3v supply to the GND pin on the arduino?

If so then, I will need to do further tests when my pro micro comes in.

What about when it isn't being used with the joystick library, does it work on its own correctly? If it does then maybe the two libraries are conflicting with each other.

Its work fine without your file, i test with another WiiClassic.h, attached it.
This another WiiClassic show in the "monitor Serial" all buttons ok, but i need change all the code for use this WiiClassic with Joystick.h and make windows recognize arduino like a joystick.

Your file is perfect, but with me have this little bug.
I will try something more and post.

Thank you again!

WiiClassic.h (4.99 KB)

teste_wii.ino (2 KB)

I see the bug your getting, but I see it with that WiiClassic library. The WiiClassic library is what my library was designed to fix. I too used the WiiClassic, but found it had weird bugs like multiple buttons being pressed even though I only pushed one. (Like what you are seeing with mine)

Perhaps the issue is with the controller itself, who knows. My controller is the second model with the hand grips. Maybe you have the original model (no grips). I don't know as you didn't show a picture of what you have.

I will try to also get the first model controller too and see if it is in fact the controller causing this bug. (Next pay check.)

thanks man, Yeah i have the first classic controller,i will try something different too and post!

Ok,
I just got the classic model 1 controller and aside from it being used and difficult to register a button press, it does work with my library. I have yet to try it on my Pro Micro, so I will give that a go tomorrow and see what happens.

HazardsMind:
I see the bug your getting, but I see it with that WiiClassic library. The WiiClassic library is what my library was designed to fix. I too used the WiiClassic, but found it had weird bugs like multiple buttons being pressed even though I only pushed one. (Like what you are seeing with mine)

Perhaps the issue is with the controller itself, who knows. My controller is the second model with the hand grips. Maybe you have the original model (no grips). I don't know as you didn't show a picture of what you have.

I will try to also get the first model controller too and see if it is in fact the controller causing this bug. (Next pay check.)

Hi, i tested with an Original Arduino Leonardo , and the error still the same, very stranger.
What version of Arduino IDE are you using?

Thank you

1.6.0 and 1.6.12

After much trial and error and even getting a new model 1 controller, it still works just fine for me. I am not able to recreate your bug. I can even play one of my roms with the wii controller as an actual USB gamepad.

Maybe try getting a new controller.

Very Thank you for your time man, i got an old code and i modified for me, now i can get work, but not for analogic. Need learn more about it. I was able to do it comparing with your code. Thank you again!