123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|684|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Off Topic -> ArdWiiNo?

Sat, 20 May 2017, 15:17
spinal
for some stupid reason, I can't make my wii classic controller work with my arduino pro micro.grrr...

-=-=-
Check out my excellent homepage!
Sat, 20 May 2017, 15:17
Jayenkai
Did you get this sorted?
Sun, 21 May 2017, 05:24
spinal
Sort of. Not sue what it was, but on the 15th re-wiring and using different software attempt, it works.
However, the plan is to use my 8bitdo nes classic bluetooth adapter. It can use almost any bluetooth controller and presents it as a wii classic controller (sort of). The issue is that it seems to send the data completely wrong. I can't find any info on the format it's sending the data, but compared to a normal classic controller, the left analog stick sends one axis as left analog, the other axis as right analog, the right analog sends one axis as right analog and the other as one of the trigger analogs and no digital buttons.
Currently I'm stumped.

-=-=-
Check out my excellent homepage!
Sun, 21 May 2017, 06:56
Jayenkai
That sounds awfully confusing!!

Confounded controllers are a pain.
I had to include an "invert Y stick" option in my Framework, because X360 pads seem to send the Y values the wrong bloody way around..
..

And they're supposed to be the standard!!

-=-=-
''Load, Next List!''
Sun, 21 May 2017, 12:42
spinal
Right...

So, standard Wii classic controllers send 6 bytes per read, as follows -


So, after getting no button data at all from the usual classic controller code, I figured I'd simple request more data from the controller, so I first requested 16 bytes and the last few were all 0, so I reduced that to just what I could see were changing, 8 bytes in all.
The format seems very similar to the standard classic controller data, other than a couple of 0's in the middle.

one thing to note, is that when handshaking with the controller, a regular classic replies with "0,0,164,32,1,1,0,0", the last two 0's aren't mentioned anywhere on the internet that I could see. But this adapter replies with "0,0,164,32,1,1,132,134". My guess is that the 132,134 is probably to represent something like a wii motion plus adapter, just a guess though as other than that, it 'seems' to be a classic controller.




-=-=-
Check out my excellent homepage!
Thu, 01 Jun 2017, 13:38
spinal
Progress update...

Started over, basing the code and the simplest wii nunchick library I could find. Scrapped some of it, rewrote the wrong bits...
wii_Controller_3.h


Wii_Controller_3.ino


Currently I can set an official Classic Controller to use the same data format as my 8bitdo adapter, but can't set the 8bitdo adapter to use any other format, so I suppose they haven't allowed for that feature. I would guess that the NES Classic attempts to force that format anyway, so it works fine on there.

For some reason though, now my nunchuck reports itself as a classic controller, I have no idea how or why.

Half way there though, soon I will have a classic controller (or almost any bluetooth controller) to n64 (probably) adapter... minus rumble

|edit|
Actually, it seems I need a delay to give the controller time to respond...

Now all three of my controllers id themselves as the correct ones.
However, the 8bitdo adapter id's itself as using type 1 data instead of type 3 I can't use that to tell them apart then.

-=-=-
Check out my excellent homepage!
Thu, 01 Jun 2017, 13:46
Jayenkai
Way over my head!!!
Thu, 01 Jun 2017, 13:49
spinal
Some of the reading is here.. wiibrew.org/wiki/Wiimote/Extension_Controllers#Identification and some here github.com/ClusterM/hakchi2/blob/master/clovercon/clovercon.c.

Not all there though, some experimenting still to do.

-=-=-
Check out my excellent homepage!
Thu, 01 Jun 2017, 13:50
Jayenkai
Good luck.

I don't envy the task ahead.
Thu, 01 Jun 2017, 14:09
spinal
It might involve a feature request to 8bitdo, as their adapter sends dataformat 3 no matter how you init the controller and no matter what format the controller says it's sending. Probably why it doesn't work properly on a real Wii.

-=-=-
Check out my excellent homepage!
Fri, 02 Jun 2017, 04:03
spinal
Just emailed a bug report/feature request to 8bitdo, pointing out that it reports the wrong data format when initially queried. Along with a feature request to allow rumble by writing a flag to an unused memory address within the adapter.
Let's see if any of those are addressed.

|edit| - Rumble would be a REALLY nice feature if they could add it. But although they do seem to update their firmwares quite often, I can't tell if they accept feature requests.

-=-=-
Check out my excellent homepage!
Sun, 04 Jun 2017, 04:52
spinal
Current progress...

Detects controller dis/re-connection
Identifies either nunchuck or classic controller.
Will attempt to put controller into mode 3.
Detects mode 3 button layout

_ToDo_
Mode 1 data format (standard classic controller)
LED to show connection status.

Wii_Controller_3.h


Wii_Controller_3.ino


-=-=-
Check out my excellent homepage!
Sun, 04 Jun 2017, 05:16
Jayenkai
Mode 3?!
Sun, 04 Jun 2017, 05:31
spinal
Wii classic controllers have multiple data formats, 1 is the 'normal' one used by default. Where some of the analog data is spread over different bytes see here. Mode 2 is unknown (by me at least). Mode 3 is what the 8bitdo uses and appears that the NES Classic attempts to use, which is the format I outlined further up the page here. Mode 4 appears to represent the motion plus adapter, which I can't really be bothered with.
Some 3rd party controllers will only use mode 1, as mode 3 was never discovered until recently. This may be why some classic controllers don't work on the NES Classic.

-=-=-
Check out my excellent homepage!
Sun, 04 Jun 2017, 05:38
Jayenkai
Geeze, no wonder controllers cost so damn much, nowadays!!
Layer upon layer of complexity!

-=-=-
''Load, Next List!''
Fri, 09 Jun 2017, 10:45
spinal
Right, currently I have N64 controller emulation working good enough to spoof my DIY N64->USB adapter. I have Wii classic controller reading working. Just not at the same time.
If I comment out the Wii cart, the N64 part works perfectly. If I comment out the N64 part, the Wii parts works perfectly. If I run both parts, the Arduino freezes up and nothing works.
Dammit!

-=-=-
Check out my excellent homepage!
Sat, 10 Jun 2017, 05:51
spinal
Hehe, You the way it happens, You ask for help on a wirld-wide platform. Then, moments after you hit the 'send' button you figure it out...

-=-=-
Check out my excellent homepage!
Sat, 10 Jun 2017, 05:54
Jayenkai
Every time!!!
Be sure to reply with your own answer, for future lookups.

-=-=-
''Load, Next List!''
Sat, 10 Jun 2017, 08:07
spinal
Good idea!

Future me... You forgot to re-enable interrupts after sending the N64 data, so as the Wii controller is running on a timer, it never gets polled again after the first initial boot!.

-=-=-
Check out my excellent homepage!