Wireless Nunchuck? It works!
Rayman
Posts: 14,652
There's cool OBEX code for the Wii Nunchuck...
Thought my wireless version would be a great way to control my BoeBot (with SpinStamp).
But, I can't get this Nyko version to work...
I just ordered a Mad Catz version off Amazon for $13.
Anybody get any of the wireless nunchuck's working with the Prop?
See below: Jon's code works with Nyko Kama wireless nunchuck that I got from Amazon.
Thought my wireless version would be a great way to control my BoeBot (with SpinStamp).
But, I can't get this Nyko version to work...
I just ordered a Mad Catz version off Amazon for $13.
Anybody get any of the wireless nunchuck's working with the Prop?
See below: Jon's code works with Nyko Kama wireless nunchuck that I got from Amazon.
Comments
The attached object works with a genuine Wii Nunchuk and is *supposed* to work with off-brands and wireless as well -- for non-Nintendo controllers there is a slight variation in the protocol (which works for all nunchuk controllers).
I just finished this about an hour ago. Please let me know if it works for you.
I'm hopefull the one I just ordered from Amazon will be more cooperative...
For full disclosure, all of this stuff is based on Arduino programs I've found on the 'net. I've attached one that has been helpful.
The receiver has a blue led that comes on as soon as it's plugged into the wiimote, but nothing i've tried makes it turn on. It does communicate though and I'm able to get the correct ID. It was very fustrating! So close, yet so far...
I'll work harder on the new unit that's coming Wednesday. I'll sniff the init sequence, if I have to...
When it works, it has to be the cheapest way to add wireless control to a system...
BTW: Wouldn't this plus the motion plus device make for a 6DOF IMU?
I'll have to take it apart now and probe the wires to see what's going on... Might take a while to find time for that...
Edit: Just noticed the date on this, I'm behind the times on wiipherals!
Hey, so am I. Glad you bumped this thread because I didn't know of its existence (2010-2011 was a very busy period). It is always great to have another handy input device (no pun intended).
BTW, I'm using a wireless Wii Nunchuck in my Halloween Hex. Here's a link:
http://forums.parallax.com/showthread.php/157497-Halloween-Hex?p=1321718&viewfull=1#post1321718
I have lots of different remote control devices but the wireless Nunchuck is my current favorite. Jon's driver make it really easy to use.
I can see why, it is a great little controller and for the price I'd be hard pressed to find one complaint about it. I did have one other issue, the buttons C and Z were swapped, so C's output would show button Z, no big deal.
Thanks Duane and Jon for the info and code, I woke up at 4am to program my latest project, will update my thread soon.
Tried several times an couldn't make it work...
But, then I re-downloaded Jon's ver2 from above in this thread.
At first it didn't work. Tried with regular Nunchuck and it worked. Retried with wireless and added delay and it worked!
Took delay out and it still worked.
So, I'm happy, but still wondering why it didn't work at first. Now, I can't make it not work...
PS: Went back to original V2 files and it still works every time. Guess I can't complain.
BTW: The Nyko Kama version seems nicer because it has blue leds that indicate connection and activity status in a more obnoxious way that is helpful.
To init my wireless nunchuk I do this:
It looks for a valid center value from the joystick before continuing into my main program. There is also a status LED that shows the program is stuck in that loop, which helps immensely! Give yourself some indicators of what is going on until you get used to how it behaves.
There are times the Nyko reciever needs a power reboot, no matter what you do it will not work until it is rebooted on the receiver side. The best way to prevent this is to get a good initial init, and keep it that way.
Don't let the controller go out of range. Flashing code can make the Nyko lock up, not always but often especially after a few Propeller reboots with power constantly applied to the Nyko rx.
Once you're done programming and using it to control something it will become much easier, I consider it very reliable.
Here's my NunchuckInit method.
The program checks the returned value from "InitNunchuck" and treats returned values of zero and -1 as a failed init.
The actual value returned is always the same on the Nyko Nunchucks but I'm not sure if the value is the same as the Wii Nunchucks.
I use the receiver on the pin 28 and 29. This has occasionally prevented new programs from being loaded to EEPROM correctly. This isn't a problem very often and when it does occur, I unplug the receiver from the little adapter I use and then reconnect it once the new program has been loaded.
Edit: I had recently modified this method. The earlier version of this method worked fine my my modifications introduced a bug. I should have tested the modified code prior to posting it. The current version appears to work as expected.
Also, I guess xanadu was talking about this Nyko wireless Nunchuck earlier too...
Anyway, seems we're all happy with Nyko.
I hadn't included the address symbol "@" in the line:
Sorry for posting untested code.