Using the Wii Motion Plus (Gyro) and Nunchuck (Accelerometer) with the Propeller
Cluso99
Posts: 18,069
The gyro is working fine but the accelerometer is always outputting the same data.
I am using the "TestMotionPlus.spin" files from the Obex by DogP.
My Wii Motion Plus and Wii Nunchucks are clones purchased on eBay earlier this year.
The results from the accelerometer are always the same...
-128,-128,-515,-490,-525,34,-136,1,1
no matter how I move the pcb. I know these results are coming from the nunchuck because I also tested the nunchuck standalone.
I have posted the code below. Note I am running my prop at 6.5MHz.
BTW I have not tested the nunchuck on a Wii as I don't have one and the nunchuck is now in pieces because I have extracted the pcbs for use in my quadcopter.
I am using the "TestMotionPlus.spin" files from the Obex by DogP.
My Wii Motion Plus and Wii Nunchucks are clones purchased on eBay earlier this year.
The results from the accelerometer are always the same...
-128,-128,-515,-490,-525,34,-136,1,1
no matter how I move the pcb. I know these results are coming from the nunchuck because I also tested the nunchuck standalone.
I have posted the code below. Note I am running my prop at 6.5MHz.
BTW I have not tested the nunchuck on a Wii as I don't have one and the nunchuck is now in pieces because I have extracted the pcbs for use in my quadcopter.
Comments
I have several projects that use a Wii Nunchuck with a Prop. I purchased several clones from Woot a while back and I have not been able to get them to work with the Prop.
I've also had a bad experience with a cloned PlayStation 2 controller. I've given up on using game controller clones.
I hope there is a solution to this problem. I have several cloned Nunchucks that I would like to use with Propeller projects.
I don't have a Wii console (nor a PS2) so I don't know if my clones will work for their intended purpose of not.
Duane
This is great! Thank you!
The Propeller can now read these cloned Nunchucks I have. This is very exciting.
I wrote a quick demo to display the data coming from the Nunchuck.
This is what the output looks like.
The numbers aren't fixed width so they don't look so pretty once the joysticks or accelerometer information changes a lot.
Thanks again,
Duane
Edit: I removed "jm" from the name of the demo. I didn't want JonnyMac to get blamed for my demo code.
I have already removed the joystick and buttons from the pcb. Once I get home later this week I will post pics of the connections and pcbs for anyone interested. It is easier than searching the web or tracing the connections.
The accelerometer values are now returned. other calculated values are also available.
Here is my latest code (derived from others code, with acknowledgements in the files).
TestMotionPlus_003 - Archive [Date 2011.11.13 Time 19.19].zip
I took the PCBs out of one of my generic Nunchucks to use as an accelerometer. I found the accelerometer values lacked the precision of the non-generic Nunchuck. They use fewer bits and scale the values up so the range is the same as Wii brand Nunchucks. I haven't checked to see if the joystick values are also lower resolution or not.
As I mentioned earlier, I had a similar problem with a generic PlayStation 2 controller. Instead of 8-bit resolution, the joysticks only had 5-bit resolution.
Duane
However, this does serve those who would like to use the wii clones (or legit) in other projects such as robots as well.